mirror of
https://github.com/Antynea/grub-btrfs.git
synced 2026-03-04 13:05:00 +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:
@@ -155,7 +155,11 @@ if [[ -d "$gbgmp" ]]; then
|
||||
printf " Success\n" >&2;
|
||||
fi
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user