#!/bin/sh # use gainroot to become root and relaunch itself and remember original tty device if [ `id -u` != 0 ] ; then TTY=`tty` #if not already root, call itself as root sudo gainroot <<EOF export TTY=$TTY $0 $* EOF exit fi TTY=${TTY:-`tty`} #set also if called directly as root # real script follows grep -q cifs /proc/modules || insmod /root/cifs.ko echo -n >$TTY "Password:" read <$TTY >/dev/null 2>&1 pass mount -t cifs //192.168.2.1/win_c$ /home/user/MyDocs/network/franta_c -o domain=FRANTA,user=Administrator,password=$pass,uid=29999,gid=29999