mirror of
https://github.com/lisanet/PiShrink-macOS.git
synced 2026-03-15 12:03:47 +00:00
Add checks for parted and bc being installed. These are most likely to
be missing on distros.
This commit is contained in:
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`
|
||||||
|
|||||||
Reference in New Issue
Block a user