Executes a script only if it isn't already running.
#!/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