View Single Post
Posts: 235 | Thanked: 339 times | Joined on Nov 2010
#437
Request: It would be nice if asui had an entry in sudoers so that "sudo asui" works. I hear that the canonical way to do this on Maemo is to put a file in /etc/sudoers.d and call "update-sudoers" from the postinst and postrm.

This would allow for snippets such as
Code:
#!/bin/sh
#taken from http://fanoush.wz.cz/maemo/initfs_flasher.tgz
# use gainroot to become root and relaunch itself
if [ `id -u` != 0 ] ; then
#if not already root, call itself as root
TTY=`tty`
[ "$TTY" = "not a tty" ] && unset TTY
exec sudo gainroot <<EOF # sudo $0 $*
if [ -z "$TTY" ] ; then exec $0 $* ; else exec <$TTY $0 $* ; fi
EOF
exit $?
fi
# real script follows
to be placed in the asui script resulting in less typing for me (I use an N800, I'm lazy )