Check for additional required commands

This commit is contained in:
Andrew Scheller 2018-01-22 03:05:31 +00:00
parent e3ff4d20aa
commit 8331faf8f3
1 changed files with 7 additions and 5 deletions

View File

@ -29,11 +29,13 @@ if (( EUID != 0 )); then
fi
#Check that what we need is installed
which parted 2>&1 >/dev/null
for command in parted losetup tune2fs md5sum e2fsck resize2fs; do
which $command 2>&1 >/dev/null
if (( $? != 0 )); then
echo "ERROR: parted is not installed."
echo "ERROR: $command is not installed."
exit -4
fi
done
#Copy to new file if requested
if [ -n "$2" ]; then