Created
March 4, 2020 16:54
-
-
Save meub/841f37de43ac954e6b32dcf039f1528e to your computer and use it in GitHub Desktop.
Bash script to check if Pi servo process is running
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export PATH="$HOME/bin:$PATH" | |
export PATH="$HOME/.local/bin:$PATH" | |
if ps -aux | grep -v grep | grep "pi-servo.py" >/dev/null | |
then | |
echo "Process is running." | |
else | |
echo "Process is not running. Starting it up..." | |
python3 /home/pi/pi-servo.py | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment