|
|
2008-06-27
, 07:57
|
|
Posts: 263 |
Thanked: 679 times |
Joined on Apr 2008
@ Lyon, France
|
#2
|
rbt
sudo gainroot
sudo reboot
|
|
2008-06-27
, 08:38
|
|
|
Posts: 4,274 |
Thanked: 5,358 times |
Joined on Sep 2007
@ Looking at y'all and sighing
|
#3
|
#!/bin/sh
if [ `id -u` != 0 ] ; then
#if not already root, call itself as root
exec sudo gainroot <<EOF
exec $0 $*
EOF
exit $?
fi
#real script follows
reboot
dbus-send --system --type=method_call --dest="com.nokia.mce" --print-reply "/com/nokia/mce/request" com.nokia.mce.request.req_reboot
| The Following User Says Thank You to qwerty12 For This Useful Post: | ||
sudo gainroot
reboot
When I "sh rbt", it only executes the first line of code and stops with a "#". It does not run the second line.
What's wrong? Help please. Thanks.