Quit when cronjob is used and PID file exists

This commit is contained in:
mboelen 2016-04-15 14:41:08 +02:00
parent cbfa62a904
commit 495b49e7a8
1 changed files with 3 additions and 1 deletions

4
lynis
View File

@ -318,11 +318,13 @@ You are advised to check for temporary files after program completion.
${YELLOW}Note: ${WHITE}Cancelling the program can leave temporary files behind${NORMAL}
"
wait_for_keypress
# Quit directly for cron jobs.
if [ ${CRONJOB} -eq 1 ]; then
echo "Quitting, to prevent multiple cron jobs running at the same time"
exit 1 # Manually exit, no cleanups to prevent deleting an active PID file
else
wait_for_keypress
fi
# Deleting any stale PID files that might exist. Note: Display function does not work yet at this point