Add checks for parted and bc being installed. These are most likely to

be missing on distros.
This commit is contained in:
Drew Bonasera 2016-04-26 12:03:43 -04:00
parent 62ba3fb3b7
commit 33aeacb375
1 changed files with 12 additions and 0 deletions

View File

@ -16,6 +16,18 @@ if (( EUID != 0 )); then
exit -3
fi
#Check that what we need is installed
A=`which parted 2>&1`
if (( $? != 0 )); then
echo "ERROR: parted is not installed."
exit -4
fi
A=`which bc 2>&1`
if (( $? != 0 )); then
echo "ERROR: bc is not installed."
exit -5
fi
#Gather info
beforesize=`ls -lah $img | cut -d ' ' -f 5`
partinfo=`parted -m $img unit B print`