Some more cleanup after closing a pnd, /pandora/appdata now gets removed as well...
authorvimacs <vimacs@pndtest>
Sun, 1 Nov 2009 16:27:38 +0000 (17:27 +0100)
committervimacs <vimacs@pndtest>
Sun, 1 Nov 2009 16:27:38 +0000 (17:27 +0100)
modified:   pnd_run.sh
modified:   sudoers

testdata/scripts/pnd_run.sh
testdata/sh/sudoers

index 7152556..5cb5759 100755 (executable)
@@ -77,6 +77,7 @@ fi
 #vars
 DFS=$(file -b $PND | awk '{ print $1 }') #is -p a zip/iso or folder?
 MOUNTPOINT=$(df $PND | sed -ne 's/.*\% \(\S*\)/\1/p' | tail -n1)
+if [ $MOUNTPOINT = "/" ]; then MOUNTPOINT=""; fi
 echo "mountpoint: $MOUNTPOINT"
 #MOUNTPOINT=$(df -h $PND | grep -E '[1-9]%' | awk '{ print $6  }') #find out which mountpoint the pnd/folder is on, there probably is a better way to do this
  
@@ -186,7 +187,7 @@ if [ $? -eq 0 ]; then # check if the umount was successfull, if it wasnt it woul
                sudo umount /mnt/pnd/$BASENAME
                sudo rmdir $MOUNTPOINT/pandora/appdata/$BASENAME/.wh..wh.plnk
                sudo rmdir $MOUNTPOINT/pandora/appdata/$BASENAME/.wh..wh..tmp 
-               sudo rmdir $MOUNTPOINT/pandora/appdata/$BASENAME/
+               sudo rmdir -p $MOUNTPOINT/pandora/appdata/$BASENAME/
                sudo rmdir /mnt/utmp/$BASENAME;
        fi
        if [ $DFS = ISO ]; then
index b720317..f7e53af 100644 (file)
@@ -4,5 +4,5 @@ ALL ALL=NOPASSWD: /etc/init.d/gdm stop, /etc/init.d/gdm start, NOEXEC: /bin/moun
 /bin/umount /mnt/pnd/*, /bin/umount /mnt/utmp/*, \
 /bin/mkdir -p /mnt/pnd/* , /bin/mkdir -p /mnt/utmp/* , /bin/mkdir -p */pandora/appdata/* , \
 /bin/rmdir /mnt/pnd/*,/bin/rmdir /mnt/utmp/* ,/bin/rmdir */pandora/appdata/*/.wh..wh.plnk, \
-/bin/rmdir */pandora/appdata/*/.wh..wh..tmp,/bin/rmdir */pandora/appdata/*/, \
+/bin/rmdir */pandora/appdata/*/.wh..wh..tmp,/bin/rmdir -p */pandora/appdata/*/, \
 /sbin/losetup /dev/loop*, /bin/mknod -m777 /dev/loop*, /sbin/losetup -d /dev/loop*, /bin/rm /dev/loop*