Bash script to monitor and email when a application stops
January 5, 2012Usage: monitor.sh PID MESSAGE EMAIL_ADDRESS
#!/bin/bash while [ -e /proc/$1 ] do sleep 1 done mail -s "$2" $3 < /dev/null
hack \etal is the blog of Nirmal J. Patel.
Usage: monitor.sh PID MESSAGE EMAIL_ADDRESS
#!/bin/bash while [ -e /proc/$1 ] do sleep 1 done mail -s "$2" $3 < /dev/null