Quote:
Originally Posted by stemy
I have a recently set up a Ubuntu server 9.04 and would like to have one small web page with two buttons on: Restart and shutdown.
Is this something that already exists or easy can bee made?
Linux newbie
|
This could be easily set up.
1. Make a PHP form with the HTML's `action' attribute set to its own address and method="post".
2. In the PHP on this page, check if the invocation was a result of the form being submitted (check the POST variables).
3. If so, run a system command (using exec(..)) from PHP to restart/shutdown. There are several options for this, try /sbin/reboot or crontab (in the terminal type "man crontab" or "man reboot" to see the manuals for these). You will need enough privileges, as was said earlier.
Make sure that you use some sort of authentication and restrict access to the page to SSL/TLS only, etc. otherwise various kids will be restarting your server all day long.
Recent comments
2 hours 11 min ago
3 hours 11 min ago
6 hours 58 min ago
8 hours 12 min ago
11 hours 48 min ago
19 hours 3 min ago
1 day 3 hours ago
1 day 5 hours ago
1 day 20 hours ago
1 day 22 hours ago