mirror of
https://github.com/Antynea/grub-btrfs.git
synced 2026-10-20 02:42:03 +08:00
Adds security if a false positive is detected
* Adds security if a false positive is detected: * if the command "grep -qs "$gbgmp" /proc/mounts;" returns a false positive. "rm -d" will return an error if the directory is not empty.
This commit is contained in:
+5
-1
@@ -155,7 +155,11 @@ if [[ -d "$gbgmp" ]]; then
|
|||||||
printf " Success\n" >&2;
|
printf " Success\n" >&2;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
[[ "$wait" != true ]] && rm -r "$gbgmp" # If mount point is empty or unmounted, delete residual folder.
|
if [[ "$wait" != true ]]; then
|
||||||
|
if ! rm -d "$gbgmp" >/dev/null 2>&1; then
|
||||||
|
printf "Unable to delete %s: Device or ressource is busy" "$gbgmp" >&2;
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user