Skip to content

Instantly share code, notes, and snippets.

@phra
Forked from padovah4ck/cronmonit.sh
Created June 28, 2018 16:08
Show Gist options
  • Save phra/d06179f1bb61bcf882ca57fdbce65c3d to your computer and use it in GitHub Desktop.
Save phra/d06179f1bb61bcf882ca57fdbce65c3d to your computer and use it in GitHub Desktop.
ippsec process monitor script
#!/bin/bash
# Loop by line
IFS=$'\n'
old_process=$(ps aux --forest | grep -v "ps aux --forest" | grep -v "sleep 1" | grep -v $0)
while true; do
new_process=$(ps aux --forest | grep -v "ps aux --forest" | grep -v "sleep 1" | grep -v $0)
diff <(echo "$old_process") <(echo "$new_process") | grep [\<\>]
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