added showing date and time; added conveniences

master
Adriel Sand 2021-09-26 19:16:53 +03:00
parent 4ff784d4b4
commit 6058a6dea6
1 changed files with 2 additions and 2 deletions

View File

@ -8,11 +8,11 @@ date_now=$(date +'%b %d, %Y at %H:%M')
if [[ $(cat state.txt) = "ON" ]] if [[ $(cat state.txt) = "ON" ]]
then then
echo "OFF" > state.txt echo "OFF" > state.txt
cat off.html | sed "s/date-n-time-placeholder/$date_now" > /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!" ./telegram "✅ The generator is OFF!"
else else
echo "ON" > state.txt echo "ON" > state.txt
cat on.html | sed "s/date-n-time-placeholder/$date_now" > /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. :(" ./telegram "❌ The generator is on. :("
fi fi