summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'localepurge')
-rwxr-xr-xlocalepurge8
1 files changed, 7 insertions, 1 deletions
diff --git a/localepurge b/localepurge
index e2279ed..10e32bb 100755
--- a/localepurge
+++ b/localepurge
@@ -166,7 +166,13 @@ remove() {
${ACTION} `find ${REMOVEPATH} -type f -o -type l`
if [ "$SHOWFREEDSPACE" = "enabled" ]; then
- SPACEAFTER=$(df -P ${REMOVEPATH} | awk '{if ( NR==2 ) { print $3 }}')
+ # if symlink, REMOVEPATH could be removed
+ # check from parentdir then
+ if [ -d ${REMOVEPATH} ]; then
+ SPACEAFTER=$(df -P ${REMOVEPATH} | awk '{if ( NR==2 ) { print $3 }}')
+ else
+ SPACEAFTER=$(df -P ${REMOVEPATH%/*} | awk '{if ( NR==2 ) { print $3 }}')
+ fi
SPACESUM=$(($SPACEBEFORE - $SPACEAFTER))
if test $SPACESUM -gt 0 ; then