Skip to content

Instantly share code, notes, and snippets.

@JeremieRapin
Created May 19, 2018 10:41
Show Gist options
  • Save JeremieRapin/bc35a2632c072a082d48f5503270df16 to your computer and use it in GitHub Desktop.
Save JeremieRapin/bc35a2632c072a082d48f5503270df16 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Add the following line in /etc/crontab
# * * * * * root /home/pi/watchdog.sh
#
status=$(sudo systemctl status raspotify | grep -E "(WARN|ERROR|101)")
if [ ! -z "$status" ]; then
sudo systemctl restart raspotify
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment