Skip to content

Instantly share code, notes, and snippets.

@wagesj45 wagesj45/cronpod.sh
Created Jan 9, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.