added script to output stats to a file, fixed wrong time zone on light_cuts.csv

This commit is contained in:
2021-10-01 06:45:51 +03:00
parent 0d83a384f7
commit 7c34625b25
8 changed files with 474 additions and 2 deletions

View File

@@ -10,12 +10,12 @@ then
echo "OFF" > state.txt
cat off.html | sed "s/date-n-time-placeholder/$date_now/" > /usr/local/apache2/htdocs/index.html
./telegram "✅ The generator is OFF!"
echo "OFF,$(date +'%Y/%m/%d %H:%M')" >> light_cuts.csv
echo "OFF,$(TZ='Asia/Beirut' date +'%Y/%m/%d %H:%M')" >> light_cuts.csv
else
echo "ON" > state.txt
cat on.html | sed "s/date-n-time-placeholder/$date_now/" > /usr/local/apache2/htdocs/index.html
./telegram "❌ The generator is on. :("
echo "ON,$(date +'%Y/%m/%d %H:%M')" >> light_cuts.csv
echo "ON,$(TZ='Asia/Beirut' date +'%Y/%m/%d %H:%M')" >> light_cuts.csv
fi
echo '<html><body>DONE</body></html>'