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

@@ -60,6 +60,7 @@ fi
if [[ "$unmount" = true ]]; then
cd ~/mnt
if [[ -n "$host" ]]; then
echo Unmounting ~/mnt/$valid_name
fusermount -u -z ~/mnt/$valid_name
rmdir --ignore-fail-on-non-empty ~/mnt/$valid_name &>/dev/null
else
@@ -78,9 +79,9 @@ if [[ -z "$host" ]]; then
_helpexit
fi
if [[ -d "$valid_name" ]]; then
device1=$( stat -c "%d" "$valid_name" )
device2=$( stat -c "%d" . )
if [[ -d ~/mnt/"$valid_name" ]]; then
device1=$( stat -c "%d" ~/mnt/"$valid_name" )
device2=$( stat -c "%d" ~/mnt/ )
else
device1=valid
device2=valid