Created
November 25, 2016 09:53
-
-
Save Rocketeer007/6a261aeecdc3958638497da088b2d460 to your computer and use it in GitHub Desktop.
Monitor a process and notify when it completes
This file contains hidden or 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/sh | |
trap "" HUP | |
PID=$1 | |
shift | |
MESSAGE=$* | |
while ps --pid ${PID} >/dev/null 2>&1; do | |
sleep 5 | |
done | |
notify.sh ${MESSAGE} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment