Added sanity check

This commit is contained in:
Jack-Benny Persson 2014-01-11 13:55:06 +01:00
parent 91a28bfe66
commit 99c8cff113

View File

@ -30,9 +30,7 @@ Aptget="/usr/bin/apt-get"
# Binaries entered in the list will be avalible to the script as variables with
# the first letter uppercase
Binaries=(dpkg sed awk egrep printf cat grep mktemp rm tail zenity)
# Variables
Binaries=(dpkg awk egrep printf tail zenity)
### Functions ###
@ -150,6 +148,14 @@ choice_dialog()
fi
}
# Sanity checks
for bin in $Which $Aptget; do
if [ ! -x $bin ]; then
echo "Can't execute $bin"
exit 1
fi
done
# Create variables with absolute path to binaries and check
# if we can execute it (binaries will be avaliable in
# variables with first character uppercase, such as Grep)