Last active
December 10, 2015 19:39
-
-
Save juzam/4482996 to your computer and use it in GitHub Desktop.
Super simple ISC Infocon to blink(1) script
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 | |
# reduntant check since in cygwin both options works the same way | |
if [ $OS = "cygwin" ]; then | |
BLINK1TOOL=/usr/local/bin/blink1-tool.exe | |
else | |
BLINK1TOOL=/usr/local/bin/blink1-tool | |
fi | |
# colour mapping | |
RED="0xff,0x00,0x00" | |
GREEN="0x00,0xff,0x00" | |
BLUE="0x00,0x00,0xff" | |
ORANGE="0xff,0x8c,0x00" | |
INFOCON=`curl -s https://isc.sans.edu/infocon.txt` | |
case $INFOCON in | |
green ) | |
$BLINK1TOOL --rgb $GREEN | |
;; | |
red ) | |
$BLINK1TOOL --rgb $RED | |
;; | |
orange ) | |
$BLINK1TOOL --rgb $ORANGE | |
;; | |
blue ) | |
$BLINK1TOOL --rgb $BLUE | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment