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
ACTION=="remove", SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", ATTRS{idProduct}=="0110", RUN+="/bin/systemctl stop spocon" | |
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", ATTRS{idProduct}=="0110", RUN+="/bin/systemctl start spocon" |
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/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 |