Created
December 24, 2015 11:08
-
-
Save ddierickx/646434a9603ca9c8c06e to your computer and use it in GitHub Desktop.
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 | |
GPIO_PORT=13 | |
HOSTS=(A B C) | |
for host in ${HOSTS[@]}; do | |
ping "$host" -c1 > /dev/null | |
if [ "$?" = "0" ]; then | |
gpio mode $GPIO_PORT output && gpio write $GPIO_PORT 1 | |
exit 0 | |
fi | |
done | |
gpio mode $GPIO_PORT output && gpio write $GPIO_PORT 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment