2022-12-05 16:08:47 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
function g_staleumount {
|
2022-12-05 16:37:00 +01:00
|
|
|
g_return=0
|
2022-12-05 16:08:47 +01:00
|
|
|
grep -v tracefs /proc/mounts | grep -v /run/ | cut -d' ' -f2 | while read g_mount
|
|
|
|
do
|
|
|
|
if ! timeout --signal=KILL 120 ls -d "$g_mount" >/dev/null
|
|
|
|
then
|
|
|
|
g_echo_error "Unmounting stale/hanging $g_mount with -lf"
|
|
|
|
umount -lf "$g_mount"
|
2022-12-05 16:37:00 +01:00
|
|
|
return=1
|
2022-12-05 16:08:47 +01:00
|
|
|
fi
|
|
|
|
done
|
2022-12-05 16:37:00 +01:00
|
|
|
return $g_return
|
2022-12-05 16:08:47 +01:00
|
|
|
}
|