Jods
06-11-2001, 08:55 PM
this is a script to be run be su, problem is after su has filled in the password correctly the script "hangs" instead of continuing the rest of the script. If the script could be run all over again the problem would be solved...
well, I suppose.
thanx
#!/bin/bash
S1='$LOGNAME'
S2='root'
if [ $S1!=$S2 ];
then
echo "Sorry, your logname is $LOGNAME, not root"
echo "You must have root or su access to run this script"
su
rv='$?'
if [ $rv=1 ]
then echo canceled
exit
else break
fi
else break
fi
echo "The End"
:confused:
well, I suppose.
thanx
#!/bin/bash
S1='$LOGNAME'
S2='root'
if [ $S1!=$S2 ];
then
echo "Sorry, your logname is $LOGNAME, not root"
echo "You must have root or su access to run this script"
su
rv='$?'
if [ $rv=1 ]
then echo canceled
exit
else break
fi
else break
fi
echo "The End"
:confused: