Skip to content

Instantly share code, notes, and snippets.

@nshores
Created July 27, 2020 22:23
Show Gist options
  • Save nshores/4049212f9b78c3288983d1b27aacc48a to your computer and use it in GitHub Desktop.
Save nshores/4049212f9b78c3288983d1b27aacc48a to your computer and use it in GitHub Desktop.
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