fixing already mounted checks
This commit is contained in:
@@ -44,7 +44,7 @@ _askpass() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_check_mount() {
|
_check_mount() {
|
||||||
if [[ -d "$valid_name" ]]; then
|
if [[ -d ~/mnt/"$valid_name" ]]; then
|
||||||
device1=$( stat -c "%d" ~/mnt/"$valid_name" )
|
device1=$( stat -c "%d" ~/mnt/"$valid_name" )
|
||||||
device2=$( stat -c "%d" ~/mnt )
|
device2=$( stat -c "%d" ~/mnt )
|
||||||
else
|
else
|
||||||
@@ -73,6 +73,7 @@ valid_name=$( echo "${remote%:}" | sed -e 's/:/-/g' | sed -e 's/[^A-Za-z0-9._@-]
|
|||||||
if [[ "$unmount" = true ]]; then
|
if [[ "$unmount" = true ]]; then
|
||||||
cd ~/mnt
|
cd ~/mnt
|
||||||
if [[ -n "$remote" ]]; then
|
if [[ -n "$remote" ]]; then
|
||||||
|
echo Unmounting ~/mnt/$valid_name
|
||||||
fusermount -u -z ~/mnt/$valid_name
|
fusermount -u -z ~/mnt/$valid_name
|
||||||
rmdir --ignore-fail-on-non-empty ~/mnt/$valid_name &>/dev/null
|
rmdir --ignore-fail-on-non-empty ~/mnt/$valid_name &>/dev/null
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ fi
|
|||||||
if [[ "$unmount" = true ]]; then
|
if [[ "$unmount" = true ]]; then
|
||||||
cd ~/mnt
|
cd ~/mnt
|
||||||
if [[ -n "$host" ]]; then
|
if [[ -n "$host" ]]; then
|
||||||
|
echo Unmounting ~/mnt/$valid_name
|
||||||
fusermount -u -z ~/mnt/$valid_name
|
fusermount -u -z ~/mnt/$valid_name
|
||||||
rmdir --ignore-fail-on-non-empty ~/mnt/$valid_name &>/dev/null
|
rmdir --ignore-fail-on-non-empty ~/mnt/$valid_name &>/dev/null
|
||||||
else
|
else
|
||||||
@@ -78,9 +79,9 @@ if [[ -z "$host" ]]; then
|
|||||||
_helpexit
|
_helpexit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -d "$valid_name" ]]; then
|
if [[ -d ~/mnt/"$valid_name" ]]; then
|
||||||
device1=$( stat -c "%d" "$valid_name" )
|
device1=$( stat -c "%d" ~/mnt/"$valid_name" )
|
||||||
device2=$( stat -c "%d" . )
|
device2=$( stat -c "%d" ~/mnt/ )
|
||||||
else
|
else
|
||||||
device1=valid
|
device1=valid
|
||||||
device2=valid
|
device2=valid
|
||||||
|
|||||||
Reference in New Issue
Block a user