Created
December 18, 2016 21:16
-
-
Save 0x4445565A/18d623359e0269b2310ef29955af80d7 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 | |
declare -A CONFIG | |
############################ | |
# CONFIG | |
# | |
# CONFIG[IP]=AMOUNT_OF_LEDS | |
############################ | |
PORT=43333 | |
CONFIG[192.168.192.192]=2 | |
CONFIG[192.168.192.10]=2 | |
############################ | |
# END CONFIG | |
############################ | |
if [ -z "$1" ]; then | |
LIGHT_VAL=1000 | |
else | |
LIGHT_VAL=$1 | |
fi | |
for IP in "${!CONFIG[@]}" | |
do | |
for I in $(seq 1 ${CONFIG[$IP]}) | |
do | |
echo "LED${I}_target=${LIGHT_VAL}" | nc $IP $PORT; | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment