Created
February 2, 2014 06:09
-
-
Save tamebadger/8763714 to your computer and use it in GitHub Desktop.
Shell scripts for controlling processes
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 | |
if pgrep | |
then | |
echo "exists"; | |
else | |
echo "does not exist"; | |
fi | |
#!/bin/bash | |
if pgrep -f '/usr/bin/mpd' | |
then | |
echo "running"; | |
else | |
mpd & | |
sleep 2 | |
pid=$(pgrep mpd) | |
sleep 10 | |
echo $pid | |
kill $pid | |
fi | |
#!/bin/bash | |
pid=$(pgrep busftp) | |
while ps -p $pid; do | |
sleep 1; | |
done ; node /procedures/update.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment