Added sanity check
This commit is contained in:
parent
91a28bfe66
commit
99c8cff113
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user