I want a reboot button that goes to this cgi shell script. It should redirect to another page and then shutdown the computer.
Code: Select all
#!/bin/sh
echo "content-type: text/html\n\n"
echo "<html>"
echo "<head>"
echo "<title>please wait...rebooting</title>"
echo "<meta http-equiv='refresh' content='1;url=/tools/'>"
echo "</head>"
echo "<body>"
echo "please wait..."
echo "</body>"
echo "</html>"
# These two will shutdown the pi but HTML redirect does not happen
# shutdown -k now 2>&1 </dev/null &
# OR
# shutdown -k now