Re: root from scripts Re: [maemo-developers] Is there a convenient way of switching between usb/bluetooth/wifi networking?

2006-09-22 Thread Frantisek Dufka
My second attempt to handle stdin and also return proper exit code and avoid one shell running is #!/bin/sh # use gainroot to become root and relaunch itself and remember tty if [ `id -u` != 0 ] ; then #if not already root, call itself as root TTY=`tty` [ "$TTY" = "not a tty" ] && unset TTY sudo

root from scripts Re: [maemo-developers] Is there a convenient way of switching between usb/bluetooth/wifi networking?

2006-09-22 Thread Frantisek Dufka
Greg Morgan wrote: Of course the challenge is doing something with root. If you have r&d mode enabled there is easy trick for shell scripts. #!/bin/sh # use gainroot to become root and relaunch itself if [ `id -u` != 0 ] ; then #if not already root, call itself as root sudo gainroot