Changed exit 2 to exit 1 as it seems to be The Right Thing since exit 2 is misuse-something

This commit is contained in:
Jack-Benny Persson 2013-12-26 18:58:45 +01:00
parent d344279e8d
commit 4c7b91bba4
5 changed files with 10 additions and 10 deletions

View File

@ -12,7 +12,7 @@ Arg2=$2
# Sanity checks # Sanity checks
if [ $# -ne 2 ]; then if [ $# -ne 2 ]; then
printf "`basename $0` requires two arguments\n" printf "`basename $0` requires two arguments\n"
exit 2 exit 1
fi fi
printf "Argument 1 is ${Arg1}\n" printf "Argument 1 is ${Arg1}\n"

View File

@ -8,13 +8,13 @@
# Sanity check # Sanity check
if [ $EUID -ne 0 ]; then if [ $EUID -ne 0 ]; then
echo "`basename $0` must run as root" echo "`basename $0` must run as root"
exit 2 exit 1
fi fi
rm /tmp/testdir/* 2> /dev/null rm /tmp/testdir/* 2> /dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Something went wrong when deleting files in /tmp/testdir/" echo "Something went wrong when deleting files in /tmp/testdir/"
exit 2 exit 1
fi fi
exit 0 exit 0

View File

@ -12,12 +12,12 @@ Iterate=0
# Sanity checks # Sanity checks
if [ $# -ne 1 ]; then if [ $# -ne 1 ]; then
echo "`basename $0` requires one argument" echo "`basename $0` requires one argument"
exit 2 exit 1
fi fi
if ! [ $Nr -eq $Nr &> /dev/null ]; then if ! [ $Nr -eq $Nr &> /dev/null ]; then
echo "Use only integers" echo "Use only integers"
exit 2 exit 1
fi fi
# Define our functions # Define our functions

View File

@ -12,15 +12,15 @@ Nr2=$2
# Sanity check # Sanity check
if [ $# -ne 2 ]; then if [ $# -ne 2 ]; then
echo "`basename $0` requires two arguments" echo "`basename $0` requires two arguments"
exit 2 exit 1
fi fi
if ! [ $Nr1 -eq $Nr1 &> /dev/null ]; then if ! [ $Nr1 -eq $Nr1 &> /dev/null ]; then
echo "`basename $0` only takes integers" echo "`basename $0` only takes integers"
exit 2 exit 1
elif ! [ $Nr2 -eq $Nr2 &> /dev/null ]; then elif ! [ $Nr2 -eq $Nr2 &> /dev/null ]; then
echo "`basename $0` only takes integers" echo "`basename $0` only takes integers"
exit 2 exit 1
fi fi
# Define our functions # Define our functions
@ -72,7 +72,7 @@ case "$Calc" in
;; ;;
*) *)
echo "Please use one the symlink add.sh/sub.sh/div.sh/tim.sh" echo "Please use one the symlink add.sh/sub.sh/div.sh/tim.sh"
exit 2 exit 1
;; ;;
esac esac

View File

@ -19,7 +19,7 @@ Warn=10 # Warn a how many percent full?
for bin in $Df $Awk $Sed $Logger $Mail; do for bin in $Df $Awk $Sed $Logger $Mail; do
if [ ! -x $bin ]; then if [ ! -x $bin ]; then
echo "Can't execute $bin" echo "Can't execute $bin"
exit 2 exit 1
fi fi
done done