Commit a8502492 authored by Dan Johansen's avatar Dan Johansen

another attempt at fixing dependency checking, hopefully fixed #9 now

parent 101e92ce
......@@ -41,31 +41,15 @@ if [ "$EUID" -ne 0 ]; then
fi
# Sanity checks for dependencies
if [ ! -f /usr/bin/git || ! -f /usr/sbin/git || ! -f /sbin/git || ! -f /bin/git ]; then
echo "git command is missing! Please install git!"
exit 1
elif [ ! -f /usr/bin/parted || ! -f /usr/sbin/parted || ! -f /sbin/parted || ! -f /bin/parted ]; then
echo "parted command is missing! Please install parted!"
exit 1
elif [ ! -f /usr/bin/systemd-nspawn || ! -f /usr/sbin/systemd-nspawn || ! -f /sbin/systemd-nspawn || ! -f /bin/systemd-nspawn ]; then
echo "systemd-nspawn command is missing! Please install systemd!"
exit 1
elif [ ! -f /usr/bin/wget || ! -f /usr/sbin/wget || ! -f /sbin/wget || ! -f /bin/wget ]; then
echo "wget command is missing! Please install wget!"
exit 1
elif [ ! -f /usr/bin/dialog || ! -f /usr/sbin/dialog || ! -f /sbin/dialog || ! -f /bin/dialog ]; then
echo "dialog command is missing! Please install dialog!"
exit 1
elif [ ! -f /usr/bin/bsdtar || ! -f /usr/sbin/bsdtar || ! -f /sbin/bsdtar || ! -f /bin/bsdtar ]; then
echo "bsdtar command is missing! Please install libarchive!"
exit 1
elif [ ! -f /usr/bin/openssl || ! -f /usr/sbin/openssl || ! -f /sbin/openssl || ! -f /bin/openssl ]; then
echo "openssl command is missing! Please install openssl!"
exit 1
elif [ ! -f /usr/bin/awk || ! -f /usr/sbin/awk || ! -f /sbin/awk || ! -f /bin/awk ]; then
echo "awk command is missing! Please install gawk!"
declare -a DEPENDNECIES=("git" "parted" "systemd-nspawn" "wget" "dialog" "bsdtar" "openssl" "awk")
for i in "${DEPENDNECIES[@]}"; do
if ! [[ -f "/bin/$i" || -f "/sbin/$i" || -f "/usr/bin/$i" || -f "/usr/sbin/$i" ]] ; then
echo "$i command is missing! Please install the relevant package."
exit 1
fi
fi
done
# Functions
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment