Created
April 5, 2014 07:42
-
-
Save Hypfer/9988614 to your computer and use it in GitHub Desktop.
Tvheadend Respawner
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 | |
main() { | |
while : | |
do | |
inotifywait -q -q -e modify /var/log/syslog && bash ./tvheadendrespawner.sh core | |
done | |
} | |
core() { | |
isthisimportant=`tail -5 /var/log/syslog | grep "CRASH" | grep "tvheadend"` | |
if [ -n "$isthisimportant" ]; then | |
service tvheadend restart | |
fi | |
} | |
#main class like stuff | |
case "$1" in | |
"core") | |
core | |
;; | |
*) | |
main | |
;; | |
esac | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment