-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun-heat-control.sample.remote
executable file
·39 lines (39 loc) · 1.41 KB
/
run-heat-control.sample.remote
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
#!/bin/sh
cd /home/pi/WiControl
DAYOFWEEK=$(date +"%u")
URL=mydomain.com
rm -f profile.dat
if [ "${DAYOFWEEK}" -eq 1 ]
then
wget --timeout=15 --user ******* --password ******** http://$URL/Heating/zone-1-profile-monday.dat -O profile.dat
elif [ "${DAYOFWEEK}" -eq 2 ]
then
wget --timeout=15 --user ******* --password ******** http://$URL/Heating/zone-1-profile-tuesday.dat -O profile.dat
elif [ "${DAYOFWEEK}" -eq 3 ]
then
wget --timeout=15 --user ******* --password ******** http://$URL/Heating/zone-1-profile-wednesday.dat -O profile.dat
elif [ "${DAYOFWEEK}" -eq 4 ]
then
wget --timeout=15 --user ******* --password ******** http://$URL/Heating/zone-1-profile-thursday.dat -O profile.dat
elif [ "${DAYOFWEEK}" -eq 5 ]
then
wget --timeout=15 --user ******* --password ******** http://$URL/Heating/zone-1-profile-friday.dat -O profile.dat
elif [ "${DAYOFWEEK}" -eq 6 ]
then
wget --timeout=15 --user ******* --password ******** http://$URL/Heating/zone-1-profile-saturday.dat -O profile.dat
elif [ "${DAYOFWEEK}" -eq 7 ]
then
wget --timeout=15 --user ******* --password ******** http://$URL/Heating/zone-1-profile-sunday.dat -O profile.dat
else
echo "Can't find the day of the week!"
fi
if [ ! -f profile.dat ]
then
cp backup-profile.dat profile.dat
fi
./Pi-Control/bin/Heating -p /dev/ttyUSB0 -i profile.dat -o zone-1-temperatures.dat > Status 2>&1
./sendtemps
if [ -f Log ]
then
cat Status >> Log
fi