Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
check_patio_monitor.sh
#!/bin/sh
if pgrep -f "python3 patio_light_notify.py"; then
pid=$(pidof python3 patio_light_notify.py)
echo "pid of patio_light_notify:" $pid
echo "it is already running"
exit
else
echo "starting patio notify script"
cd /home/zoneminder/
python3 patio_light_notify.py &
pid=$(pidof python3 patio_light_notify.py)
echo "pid of patio_light_notify:" $pid
fi
exit 0
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.