Steam for Linux

Steam for Linux

[SOLVED] Start BASH script with sudo commands from steam
I'm currently trying to reboot my ubuntu system to windows using a steam shortcut.
I added the following script to my steam library:

#!/bin/bash sudo grub-reboot "Windows" >> test 2>&1 sudo reboot >> test 2>&1

I also added grub-reboot and reboot to sudoers:
hashworks ALL = (root) NOPASSWD: /usr/sbin/grub-reboot hashworks ALL = (root) NOPASSWD: /usr/sbin/reboot

Manually the script works just fine, also steam executes it as 'hashworks'.
However, the output of the file "test" is the following:
Sudo: no tty present and no askpass program specificed

Any idea?
Dernière modification de hashworks; 1 juil. 2014 à 9h38
< >
Affichage des commentaires 1 à 4 sur 4
oh i don't know... maybe you need to input the password for sudo to work?
You might try making your script launch a new terminal window with the commands you want so that you're able to enter your password.
I don't think it would be wise to set it up so that you don't have to enter your password, it would be a huge security risk.

However, to allow yourself to enter a password you could try something like this
(this is for a rxvt-unicode terminal, if you use something else you'll have to modify it)
#!/bin/bash urxvt -e sudo grub-reboot "Windows" >> test 2>&1 && sudo reboot >> test 2>&1

that will start a terminal window and pass in the 2 commands to that new session to be run, which will allow you to enter your password.

If you need help modifying the command please tell us which terminal emulator you use
Dernière modification de :ekoe; 30 juin 2014 à 20h05
Angry Mongoose a écrit :
oh i don't know... maybe you need to input the password for sudo to work?

Thats why I used the sudoers file. I need to reboot the pc to windows using Steam Streaming from somewhere in the house.

You might try making your script launch a new terminal window with the commands you want so that you're able to enter your password.
I don't think it would be wise to set it up so that you don't have to enter your password, it would be a huge security risk.

I'm ok with limiting the risk to reboot and grub-reboot, everything else needs a pw of course. I'm absolutly unable to enter a password from the couch with a xbox360 controller in my hands.

Angry Mongoose a écrit :
However, to allow yourself to enter a password you could try something like this
(this is for a rxvt-unicode terminal, if you use something else you'll have to modify it)
#!/bin/bash urxvt -e sudo grub-reboot "Windows" >> test 2>&1 && sudo reboot >> test 2>&1

Mhm, I already had that idea with gnome-terminal,
which didn't work because of other stuff.

However, trying urxvt only grub-reboot worked - reboot requested a password.
Looking at /etc/sudoers showed me that the path in there was wrong (it's /sbin/reboot and not /usr/sbin/reboot). At the moment I tryed the script manually I already entered the sudo pw once leaving the sudoers file untestet (♥♥♥♥♥♥♥♥♥♥, yesterday-me...)

So I changed the path and now everything is working fine, without urxvt. Thanks for the help mearo!
Dernière modification de hashworks; 30 juin 2014 à 22h38
glad you got it working
< >
Affichage des commentaires 1 à 4 sur 4
Par page : 1530 50

Posté le 30 juin 2014 à 14h07
Messages : 4