Hello to all,
I have this code :
echo "$SERVICE is not running" >> /var/log/messages
START=$(date +%s)
exec '/home/m6s/projects/services/runtest.sh'
END=$(date + %s)
echo $END
DIFF=$(( $END - $START ))
echo $DIFF
echo "$SERVICE, took $DIFF seconds" >> /var/log/messages
It takes the time it started, it tries to executed the runtest.sh, and then it is supposed to return back to the main program after the execution take the END, calculate the DIFF and report the result to /var/log/messages.
But when the second program terminates, it terminates entire script. At least is seems so. What is wrong with this snippet?
Thank you in advance...
I have this code :
echo "$SERVICE is not running" >> /var/log/messages
START=$(date +%s)
exec '/home/m6s/projects/services/runtest.sh'
END=$(date + %s)
echo $END
DIFF=$(( $END - $START ))
echo $DIFF
echo "$SERVICE, took $DIFF seconds" >> /var/log/messages
It takes the time it started, it tries to executed the runtest.sh, and then it is supposed to return back to the main program after the execution take the END, calculate the DIFF and report the result to /var/log/messages.
But when the second program terminates, it terminates entire script. At least is seems so. What is wrong with this snippet?
Thank you in advance...
Comment