forked from rajid/NixieServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSunday_red.sh
executable file
·68 lines (65 loc) · 1.34 KB
/
Sunday_red.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh -xv
#./CLITool clock <./input &
while true; do
hour=`date +"%H"`
min=`date +"%M"`
if [ $min -eq 0 ]; then
weekday=`date "+%a"`
case $weekday in
Sun)
echo leds 20 0 0 >./input
;;
Mon)
echo leds 17 3 0 >./input
;;
Tue)
echo leds 14 6 0 >./input
;;
Wed)
echo leds 0 20 0 >./input
;;
Thu)
echo leds 0 10 10 >./input
;;
Fri)
echo leds 0 0 20 >./input
;;
Sat)
echo leds 10 0 10 >./input
;;
esac
sleep 1
fi
# Don't display anything between 2am and 6am
if [ $hour -ge 2 -a $hour -lt 6 ]; then
echo " " >./input
sleep 30
continue
elif [ $hour -ne 0 -o $min -gt 0 ]; then
x=`curl http://192.168.0.47/cgi-bin/gettemp.pl?sensor=out 2>/dev/null`
out=`dc -e "$x 1 / p"`
x=`curl http://192.168.0.47/cgi-bin/gettemp.pl?sensor=in 2>/dev/null`
in=`dc -e "$x 1 / p"`
if [ $in -eq 0 -o $out -eq 0 ]; then
sleep 10
continue
fi
echo "dots 0 0" >./input
sleep 1
if [ $out -ge 100 ]; then
echo "${in} ${out}" >./input
else
echo "${in} ${out}" >./input
fi
sleep 5
fi
# echo "dots 1 1" >./input
sleep 1
echo "clock" >./input
if [ $hour -eq 0 -a $min -eq 0 ]; then
echo "roulette" >./input
echo "clock" >./input
sleep 50
fi
sleep 10
done