From: W. Trevor King Date: Wed, 24 Mar 2010 11:43:50 +0000 (-0400) Subject: Check for failed SIZE calculation in sysresccd-custom X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cd5fa96d458ad9cffff8625020c4277bd132354d;p=systemrescuecd.git Check for failed SIZE calculation in sysresccd-custom Also removed redundant "exit 1" calls after help_readman calls. --- diff --git a/portage-overlay/sys-apps/sysresccd-scripts/files/sysresccd-custom b/portage-overlay/sys-apps/sysresccd-scripts/files/sysresccd-custom index f765335..2cd8484 100755 --- a/portage-overlay/sys-apps/sysresccd-scripts/files/sysresccd-custom +++ b/portage-overlay/sys-apps/sysresccd-scripts/files/sysresccd-custom @@ -73,15 +73,17 @@ die() # $1 == MB required by the function check_freespace() { - SIZE=`(\df -m -P ${WORKDIR}) | grep " ${WORKDIR}$" | tail -n 1 | awk '{print $4}'` - - if [ $SIZE -gt $1 ] + SIZE=`(df -m -P ${WORKDIR}) | grep " ${WORKDIR}$" | tail -n 1 | awk '{print $4}'` + if [ -z "$SIZE" ] + then + help_readman "Could not determine amount of room in ${WORKDIR}" + fi + if [ "$SIZE" -gt $1 ] then echo "there is enough estimated free space here ($SIZE MB) -> ok" else echo "${PROG}: not enough room in ${WORKDIR}" help_readman "You only have $SIZE MB free, and the script needs at least $1 MB free" - exit 1 fi } @@ -272,7 +274,6 @@ fi if [ ! -d "${WORKDIR}" ] then help_readman "${PROG}: You need to mount a partition with free space on ${WORKDIR}" - exit 1 fi case "${COMMAND}" in