added the cgi script

master
Adriel Sand 2021-09-22 21:20:08 +03:00
parent 13c1520dfd
commit 98219880fd
1 changed files with 19 additions and 0 deletions

19
make-new-file.cgi 100755
View File

@ -0,0 +1,19 @@
#!/bin/bash
echo "Content-type: text/html"
echo ""
if [[ $(cat state.txt) = "ON" ]]
then
echo "OFF" > state.txt
echo $(cat off.html) > /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
./telegram "❌ The generator is on. :("
fi
echo '<html><body>DONE</body></html>'
exit 0