local/bin/encfsw: rmdir mount point on failure

master
Pierre Neidhardt 2019-01-30 14:58:00 +01:00
parent a11427e0d6
commit 24a30ce179
1 changed files with 2 additions and 2 deletions

View File

@ -27,9 +27,9 @@ mount() {
MOUNTPOINT="${SOURCE}_decrypted"
mkdir -p "$MOUNTPOINT"
if [ -z "$PASS" ]; then
encfs "$SOURCE" "$MOUNTPOINT"
encfs "$SOURCE" "$MOUNTPOINT" || rmdir "$MOUNTPOINT"
else
echo "$PASS" | encfs --stdinpass "$SOURCE" "$MOUNTPOINT"
echo "$PASS" | encfs --stdinpass "$SOURCE" "$MOUNTPOINT" || rmdir "$MOUNTPOINT"
fi
}