added showing date and time; added conveniences

This commit is contained in:
2021-09-26 18:23:53 +03:00
parent ebe99294fb
commit 4ff784d4b4
4 changed files with 63 additions and 13 deletions

View File

@@ -3,14 +3,16 @@
echo "Content-type: text/html"
echo ""
date_now=$(date +'%b %d, %Y at %H:%M')
if [[ $(cat state.txt) = "ON" ]]
then
echo "OFF" > state.txt
echo $(cat off.html) > /usr/local/apache2/htdocs/index.html
cat off.html | sed "s/date-n-time-placeholder/$date_now" > /usr/local/apache2/htdocs/index.html
./telegram "✅ The generator is OFF!"
else
echo "ON" > state.txt
echo $(cat on.html) > /usr/local/apache2/htdocs/index.html
cat on.html | sed "s/date-n-time-placeholder/$date_now" > /usr/local/apache2/htdocs/index.html
./telegram "❌ The generator is on. :("
fi