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
15 hours 51 min ago
22 hours 32 min ago
1 day 2 hours ago
1 day 4 hours ago
1 day 12 hours ago
1 day 21 hours ago
1 day 22 hours ago
2 days 2 hours ago
2 days 6 hours ago
2 days 7 hours ago