set timeout for wget and kill slow processes
(e.g. in case controller is turned off)
This commit is contained in:
parent
478f9224de
commit
5b8b44bc3d
4
light.sh
4
light.sh
|
@ -98,7 +98,7 @@ case "$ROOM_NUMBER" in
|
||||||
DR=$(sign $(($R_-$R))); DG=$(sign $(($G_-$G))); DB=$(sign $(($B_-$B)))
|
DR=$(sign $(($R_-$R))); DG=$(sign $(($G_-$G))); DB=$(sign $(($B_-$B)))
|
||||||
R=$(($R+$DR)); G=$((G+$DG)); B=$(($B+$DB))
|
R=$(($R+$DR)); G=$((G+$DG)); B=$(($B+$DB))
|
||||||
for i in 5:$R 4:$G 3:$B; do
|
for i in 5:$R 4:$G 3:$B; do
|
||||||
wget -q -O- http://172.23.92.5/ecmd?channel%20$(echo $i | cut -d: -f1)%20$(echo $i | cut -d: -f2) > /dev/null 2>&1 &
|
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 &
|
||||||
COLOR_B_TMP="$(echo "$COLOR_B_TMP" | cut -c3-)"
|
COLOR_B_TMP="$(echo "$COLOR_B_TMP" | cut -c3-)"
|
||||||
done
|
done
|
||||||
sleep .1
|
sleep .1
|
||||||
|
@ -109,7 +109,7 @@ case "$ROOM_NUMBER" in
|
||||||
else
|
else
|
||||||
COLOR_B_TMP=$COLOR_B
|
COLOR_B_TMP=$COLOR_B
|
||||||
for i in 5 4 3; do
|
for i in 5 4 3; do
|
||||||
wget -q -O- http://172.23.92.5/ecmd?channel%20$i%20$(printf "%d" "0x${COLOR_B_TMP:0:2}") > /dev/null 2>&1 &
|
wget -q --timeout 3 -O- http://172.23.92.5/ecmd?channel%20$i%20$(printf "%d" "0x${COLOR_B_TMP:0:2}") > /dev/null 2>&1 &
|
||||||
COLOR_B_TMP="$(echo "$COLOR_B_TMP" | cut -c3-)"
|
COLOR_B_TMP="$(echo "$COLOR_B_TMP" | cut -c3-)"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue