chiark / gitweb /
* chiark-backup: remove snap-mount properly whether it's a dir or a leaf
[chiark-utils.git] / backup / nosnap
index c1f16dd..b9d57ab 100755 (executable)
@@ -3,7 +3,12 @@
 set -e
 
 removes () {
-       rm -f -- "$vardir/snap-mount" "$vardir/snap-device"
+       if test -d "$vardir/snap-mount"; then
+               rmdir -- "$vardir/snap-mount"
+       else
+               rm -f -- "$vardir/snap-mount"
+       fi
+       rm -f -- "$vardir/snap-device"
 }
 
 vardir="$2"