Changed 'exit 2' to 'exit 1' as it seems to be The Right Thing
This commit is contained in:
parent
4c7b91bba4
commit
a836db6394
@ -11,7 +11,7 @@ Whereis="/usr/bin/whereis"
|
||||
# Santiy checks
|
||||
if [ ! -x $Dialog ]; then
|
||||
echo "Can't excute $Dialog"
|
||||
exit 2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Main
|
||||
@ -25,7 +25,7 @@ BinPath=`$Whereis $Browser | awk '{ print $2 }'`
|
||||
echo $BinPath | grep / &> /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
$Dialog --msgbox "It seems that you don't have $Browser installed" 10 60
|
||||
exit 2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$Dialog --infobox "Starting up $Browser for you" 10 60
|
||||
|
@ -11,7 +11,7 @@ Whereis="/usr/bin/whereis"
|
||||
# Santiy checks
|
||||
if [ ! -x $Zenity ]; then
|
||||
echo "Can't excute $Zenity"
|
||||
exit 2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Main
|
||||
@ -25,7 +25,7 @@ BinPath=`$Whereis $Browser | awk '{ print $2 }'`
|
||||
echo $BinPath | grep / &> /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
$Zenity --info --text="It seems you don't have $Browser installed"
|
||||
exit 2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$BinPath &
|
||||
|
@ -15,13 +15,13 @@ Printf="/usr/bin/printf"
|
||||
# Sanity checks
|
||||
if [ ! -w `dirname $File` ]; then
|
||||
echo "Can't write to `dirname $File`"
|
||||
exit 2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for bin in $Awk $Dialog $Printf; do
|
||||
if [ ! -x $Bin ]; then
|
||||
echo "Can't execute $Bin"
|
||||
exit 2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
|
@ -16,18 +16,18 @@ Rm="/bin/rm"
|
||||
# Sanity checks
|
||||
if [ ! -w `dirname $File` ]; then
|
||||
echo "Can't write to `dirname $File`"
|
||||
exit 2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -w /tmp/ ]; then
|
||||
echo "Can't write to /tmp/"
|
||||
exit 2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for bin in $Awk $Zenity $Printf $Rm; do
|
||||
if [ ! -x $Bin ]; then
|
||||
echo "Can't execute $Bin"
|
||||
exit 2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
|
@ -21,7 +21,7 @@ ask()
|
||||
2> /tmp/createuser
|
||||
if [ $? -eq 255 ]; then
|
||||
echo "Aborting, user hit ESC"
|
||||
exit 2
|
||||
exit 1
|
||||
fi
|
||||
Input=`$Cat /tmp/createuser`
|
||||
|
||||
@ -31,13 +31,13 @@ ask()
|
||||
# Sanity checks
|
||||
if [ $EUID -ne 0 ]; then
|
||||
echo "You need to run this script as root"
|
||||
exit 2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for bin in $Chpasswd $Useradd $Dialog $Grep $Cat $Rm; do
|
||||
if [ ! -x $bin ]; then
|
||||
echo "Can't execute $bin"
|
||||
exit 2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
@ -56,7 +56,7 @@ $Dialog --backtitle "Create new user"\
|
||||
2> /tmp/createuser
|
||||
if [ $? -eq 255 ]; then
|
||||
echo "Aborting, user hit ESC"
|
||||
exit 2
|
||||
exit 1
|
||||
fi
|
||||
Input=`$Cat /tmp/createuser`
|
||||
UserShell=$Input
|
||||
|
@ -25,7 +25,7 @@ ask()
|
||||
> /tmp/createuser
|
||||
if [ $? -eq 1 ]; then
|
||||
echo "Aborting, user hit cancel..."
|
||||
exit 2
|
||||
exit 1
|
||||
fi
|
||||
Input=`$Cat /tmp/createuser`
|
||||
}
|
||||
@ -42,13 +42,13 @@ extract_data()
|
||||
# Sanity checks
|
||||
if [ $EUID -ne 0 ]; then
|
||||
echo "You need to run this script as root"
|
||||
exit 2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for bin in $Chpasswd $Useradd $Zenity $Grep $Cat $Rm; do
|
||||
if [ ! -x $bin ]; then
|
||||
echo "Can't execute $bin"
|
||||
exit 2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
@ -67,7 +67,7 @@ $Rm /tmp/createuser
|
||||
$Useradd -m -s $UserShell -c "$Comment" $Username
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Couldn't create new user $Username, aborting"
|
||||
exit 2
|
||||
exit 1
|
||||
fi
|
||||
echo "${Username}:${Password}" | $Chpasswd
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user