fixing already mounted checks

This commit is contained in:
Ville Rantanen
2023-01-02 08:37:45 +02:00
parent 6b24386b42
commit c06abacd38
2 changed files with 6 additions and 4 deletions

View File

@@ -44,7 +44,7 @@ _askpass() {
}
_check_mount() {
if [[ -d "$valid_name" ]]; then
if [[ -d ~/mnt/"$valid_name" ]]; then
device1=$( stat -c "%d" ~/mnt/"$valid_name" )
device2=$( stat -c "%d" ~/mnt )
else
@@ -73,6 +73,7 @@ valid_name=$( echo "${remote%:}" | sed -e 's/:/-/g' | sed -e 's/[^A-Za-z0-9._@-]
if [[ "$unmount" = true ]]; then
cd ~/mnt
if [[ -n "$remote" ]]; then
echo Unmounting ~/mnt/$valid_name
fusermount -u -z ~/mnt/$valid_name
rmdir --ignore-fail-on-non-empty ~/mnt/$valid_name &>/dev/null
else