Guest mahiles Posted August 9, 2003 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 Link to comment Share on other sites More sharing options...
Cannonfodder Posted August 9, 2003 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. Link to comment Share on other sites More sharing options...
Guest mahiles Posted August 9, 2003 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? Link to comment Share on other sites More sharing options...
scoopy Posted August 9, 2003 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. Link to comment Share on other sites More sharing options...
Guest mahiles Posted August 9, 2003 Share Posted August 9, 2003 Halt works with any user but I can't see any way of setting a delay using that? Link to comment Share on other sites More sharing options...
Germ Posted August 10, 2003 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 Link to comment Share on other sites More sharing options...
bvc Posted August 10, 2003 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now