From 495b49e7a8a92cc17bee174f4215844469302dcb Mon Sep 17 00:00:00 2001 From: mboelen Date: Fri, 15 Apr 2016 14:41:08 +0200 Subject: [PATCH] Quit when cronjob is used and PID file exists --- lynis | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lynis b/lynis index 5a02569b..bfed1256 100755 --- a/lynis +++ b/lynis @@ -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