Created
January 9, 2019 04:23
-
-
Save wagesj45/d1a89430f8090550d9660ab405b66c0e to your computer and use it in GitHub Desktop.
Executes a script only if it isn't already running.
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 | |
isrunning=$(ps -ef | grep -v grep | grep "podcast.sh" | wc -l) | |
if [ "$isrunning" -gt "0" ]; then | |
echo "[ALREADY RUNNING]" | |
exit 0 | |
else | |
sudo /home/[your username]/podcast.sh | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment