Created
June 4, 2016 03:02
-
-
Save r-k-b/c6c280a2cc3b30a1c53bb80f8ad4cf4c to your computer and use it in GitHub Desktop.
Make a sound when a particularly interesting line comes through syslog
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 | |
shopt -s nocasematch | |
tail -F /var/log/syslog -n 100 | grep --line-buffered -iE -e 'adsl link (up|down)' | while read -r line ; do | |
echo "Processing $line" | |
[[ $line =~ (adsl link (up|down)) ]] && | |
newState="${BASH_REMATCH[1]}" && | |
echo $newState && | |
spd-say "Hey! $newState" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment