Decode octal-escaped mountpoints and disown backgrounded restart

/proc/mounts uses octal escaping for special characters (e.g. \040 for
spaces). Decode with printf before passing to fusermount so paths with
spaces are handled correctly.

Add disown after backgrounding the gvfs restart so it survives
systemd-sleep's cgroup cleanup when the hook script exits.
This commit is contained in:
Alan Sikora
2026-03-08 23:42:01 -03:00
parent e490ca7d78
commit cce8d878ec
@@ -8,6 +8,7 @@
if [[ $1 == "pre" ]]; then
while IFS=' ' read -r _ mountpoint fstype _; do
if [[ $fstype == fuse.* ]]; then
mountpoint=$(printf '%b' "$mountpoint")
fusermount3 -uz "$mountpoint" 2>/dev/null || fusermount -uz "$mountpoint" 2>/dev/null || true
fi
done < /proc/mounts
@@ -28,4 +29,5 @@ if [[ $1 == "post" ]]; then
fi
done
) &
disown
fi