From cd5fa96d458ad9cffff8625020c4277bd132354d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 24 Mar 2010 07:43:50 -0400 Subject: [PATCH] Check for failed SIZE calculation in sysresccd-custom Also removed redundant "exit 1" calls after help_readman calls. --- .../sys-apps/sysresccd-scripts/files/sysresccd-custom | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 -- 2.26.2