#!/bin/sh # 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 if [ -z "$TTY" ] ; then exec $0 $* ; else exec <$TTY $0 $* ; fi EOF exit $? fi chroot /mnt/initfs dsmetest -l 3 exit