Skip to content

Instantly share code, notes, and snippets.

@0x4445565A
Created December 18, 2016 21:16
Show Gist options
  • Save 0x4445565A/18d623359e0269b2310ef29955af80d7 to your computer and use it in GitHub Desktop.
Save 0x4445565A/18d623359e0269b2310ef29955af80d7 to your computer and use it in GitHub Desktop.
#!/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