added showing date and time; added conveniences
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user