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