Created
June 2, 2018 21:23
-
-
Save phra/95417a1588cc211a45bd8fbab79221d7 to your computer and use it in GitHub Desktop.
Detect cronjobs without reading permission
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IFS=$'\n' | |
old_process=$(ps -eo command) | |
while true; do | |
new_process=$(ps -eo command) | |
diff <(echo "$old_process") <(echo "$new_process") | |
sleep 1 | |
old_process=$new_process | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment