Skip to content

Instantly share code, notes, and snippets.

@nshores
Created July 27, 2020 22:23
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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