chiark / gitweb /
git-branchmove: new script, still work in progress
[chiark-utils.git] / backup / nosnap
index c1f16dd59bc8fec36d92f3ceb795fa302b864411..06187fac0bbfaf88ce821ee16369ba3fa535fac5 100755 (executable)
@@ -3,7 +3,12 @@
 set -e
 
 removes () {
 set -e
 
 removes () {
-       rm -f -- "$vardir/snap-mount" "$vardir/snap-device"
+       if test -L "$vardir/snap-mount"; then
+               rm -f -- "$vardir/snap-mount"
+       elif test -d "$vardir/snap-mount"; then
+               rmdir -- "$vardir/snap-mount"
+       fi
+       rm -f -- "$vardir/snap-device"
 }
 
 vardir="$2"
 }
 
 vardir="$2"