Add checks for parted and bc being installed. These are most likely to
be missing on distros.
This commit is contained in:
parent
62ba3fb3b7
commit
33aeacb375
12
pishrink.sh
12
pishrink.sh
|
@ -16,6 +16,18 @@ if (( EUID != 0 )); then
|
||||||
exit -3
|
exit -3
|
||||||
fi
|
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
|
#Gather info
|
||||||
beforesize=`ls -lah $img | cut -d ' ' -f 5`
|
beforesize=`ls -lah $img | cut -d ' ' -f 5`
|
||||||
partinfo=`parted -m $img unit B print`
|
partinfo=`parted -m $img unit B print`
|
||||||
|
|
Loading…
Reference in New Issue