Guest mahiles Posted August 9, 2003 Report Share Posted August 9, 2003 Is there anyway I could create a file that, when executed does "su" and enters the root password and then shuts down the computer? Getting even more complicated (especially for newbie me lol) could I get it to prompt me if I wanted to enter a delay time? Slightly separate question but same topic, whats the difference between doing "shutdown -h..." and skipping the -h. I know it means halt but what does that actually do? Doesn't seem to make any difference to me? Thanks Quote Link to comment Share on other sites More sharing options...
Cannonfodder Posted August 9, 2003 Report Share Posted August 9, 2003 I can type shutdown or reboot as any user. Is it different on your system? If so, you might want to investigate sudo which allows you to assign root prives to specific users for specific actions. Quote Link to comment Share on other sites More sharing options...
Guest mahiles Posted August 9, 2003 Report Share Posted August 9, 2003 I can only do shutdown with root however can do reboot with any user. How do I do that second part? Quote Link to comment Share on other sites More sharing options...
scoopy Posted August 9, 2003 Report Share Posted August 9, 2003 how bout the halt command as any user ??? You should be able to shut down from whatever user you are at the time. Quote Link to comment Share on other sites More sharing options...
Guest mahiles Posted August 9, 2003 Report Share Posted August 9, 2003 Halt works with any user but I can't see any way of setting a delay using that? Quote Link to comment Share on other sites More sharing options...
Germ Posted August 10, 2003 Report Share Posted August 10, 2003 You can't set a delay with the halt command. You can use shutdown with a delay. shutdown -h -t5 That will shut your machine down in 5 seconds. The -t option must be in seconds. /germ Quote Link to comment Share on other sites More sharing options...
bvc Posted August 10, 2003 Report Share Posted August 10, 2003 If you need halt, use sleep sleep 5; halt will make the halt command wait 5 sec before executing. You can also specify minutes, hours, and days :shock: :lol: sleep --help man sleep info sleep Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.