Skip to content
Snippets Groups Projects
Commit 726d3baa authored by Carmelo Pellegrino's avatar Carmelo Pellegrino
Browse files

lock and error message in case of already locked implemented

parent a1664e9a
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,11 @@ function rm_lock() {
}
function test_lock() {
return [ -e /tmp/auto_ss ]
if [ -e /tmp/auto_ss ]; then
return 1
else
return 0
fi
}
function createList() {
......@@ -64,6 +68,11 @@ function get_run_number() {
echo ${run_number}
}
test_lock || { zenity --error --text="There is another instance running of this program."; exit 1;}
put_lock
while [ 1 ]; do
# Ask for the run setup
......@@ -138,4 +147,6 @@ sleep ${run_duration}
zenity --info --text="Run ${run_number} finished!"
rm_lock
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment