added return code
This commit is contained in:
parent
7c276f31b8
commit
96231548a4
@ -1,12 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
function g_staleumount {
|
function g_staleumount {
|
||||||
|
g_return=0
|
||||||
grep -v tracefs /proc/mounts | grep -v /run/ | cut -d' ' -f2 | while read g_mount
|
grep -v tracefs /proc/mounts | grep -v /run/ | cut -d' ' -f2 | while read g_mount
|
||||||
do
|
do
|
||||||
if ! timeout --signal=KILL 120 ls -d "$g_mount" >/dev/null
|
if ! timeout --signal=KILL 120 ls -d "$g_mount" >/dev/null
|
||||||
then
|
then
|
||||||
g_echo_error "Unmounting stale/hanging $g_mount with -lf"
|
g_echo_error "Unmounting stale/hanging $g_mount with -lf"
|
||||||
umount -lf "$g_mount"
|
umount -lf "$g_mount"
|
||||||
|
return=1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
return $g_return
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user