added the cgi script
This commit is contained in:
19
make-new-file.cgi
Executable file
19
make-new-file.cgi
Executable 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
|
Reference in New Issue
Block a user