diff --git a/light.sh b/light.sh index ccc49b1..2439c59 100755 --- a/light.sh +++ b/light.sh @@ -137,13 +137,14 @@ case "$ROOM_NUMBER" in while [ $R -ne $R_ -o $G -ne $G_ -o $B -ne $B_ ]; do DR=$(sign $(($R_-$R))); DG=$(sign $(($G_-$G))); DB=$(sign $(($B_-$B))) R=$(($R+$DR)); G=$((G+$DG)); B=$(($B+$DB)) - PIDS="" - for i in 5:${GAMMA_LUT[$R]} 4:${GAMMA_LUT[$G]} 3:${GAMMA_LUT[$B]}; do - wget -q --timeout 3 -O- http://172.23.92.5/ecmd?channel%20$(echo $i | cut -d: -f1)%20$(echo $i | cut -d: -f2) > /dev/null 2>&1 & - PIDS="$PIDS $!" - COLOR_B_TMP="$(echo "$COLOR_B_TMP" | cut -c3-)" - done - sleep .1 + wget -q --timeout 3 -O- --input-file <( + for i in 5:${GAMMA_LUT[$R]} 4:${GAMMA_LUT[$G]} 3:${GAMMA_LUT[$B]}; do + echo "http://172.23.92.5/ecmd?channel%20$(echo $i | cut -d: -f1)%20$(echo $i | cut -d: -f2)" + COLOR_B_TMP="$(echo "$COLOR_B_TMP" | cut -c3-)" + done + ) > /dev/null 2>&1 & + PID=$! + sleep .2 kill -9 $PIDS >/dev/null 2>&1 done done @@ -158,7 +159,7 @@ case "$ROOM_NUMBER" in PIDS="$PIDS $!" COLOR_B_TMP="$(echo "$COLOR_B_TMP" | cut -c3-)" done - sleep .1 + sleep .5 kill -9 $PIDS >/dev/null 2>&1 fi ;;