]>
git.wh0rd.org - home.git/blob - .bin/umount-tree
4 mounts
=( $
(gawk
-v p
="${root%/}" '$2 ~ "^"p { print $2 }' /proc
/mounts |
tac) )
6 if ! ${toplevel} && [[ ${#mounts[@]} -gt 0 ]] ; then
7 if [[ ${mounts[-1]} == "${root%/}" ]] ; then
12 if [[ ${#mounts[@]} -eq 0 ]] ; then
14 echo "No mounts found for ${root}:"
22 printf '\t%s\n' "${mounts[@]}"
32 ${quiet} || flags
+=( -v )
33 [[ ${v} == "y" ]] && sudo umount "${flags[@]}" "${mounts[@]}"
38 echo "Usage
: $0 <root
>"
45 while [[ $# -gt 0 ]] ; do
55 while [[ $# -gt 0 ]] ; do