0
I would like run a script of mine that need some root privilegies on a gui way.
For example, a simple script could be:
#!/bin/sh
clementine
sudo shutdown -h 00:00
The first line opens the clementine music player (and I don't want root privilegies to open it) and the second will halt the computer on a specific time.
I would like run the script using Alt+F2
and a dialog ask the root password to me when it is needed.
How to do this?
Wait...replacing
sudo
withkdesudo
should work just fine. – Bobby – 2012-06-11T11:41:57.237@Bobby, I tried
Alt+F2
typedsudo
with the script localization and hit Return. Clementine opened, but the shutdown no (didn't appear nothing in system monitor)=/... – GarouDan – 2012-06-11T11:46:44.873I say it again: replacing
sudo
withkdesudo
in the simple script you posted did not work? – Bobby – 2012-06-11T11:50:34.803In the question
– GarouDan – 2012-06-11T11:51:28.317How can I pass Root Password to a script
I can see something that looks like what I'm needing, but I didn't know how can I use this to perform what I need.@Bobby, nice idea. Well just put
kdesudo shutdown -h 00:00
insteadsudo shutdown -h 00:00
doesn't work. Maybe is the commandshutdown -h 00:00
isn't made by just one parameter. But is almost^^ – GarouDan – 2012-06-11T11:55:13.803@Bobby, Yeah! Nice. Works. Change to
kdesudo "shutdown -h 00:00"
works. Please write this as answer that I will embrace it. – GarouDan – 2012-06-11T11:57:24.783