From: Mike Frysinger Date: Sat, 1 Dec 2012 18:39:30 +0000 (-0500) Subject: -y: unmount w/out prompting X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=066558c02bb5a016160df346e0045b5a0c3206a7;p=home.git -y: unmount w/out prompting --- diff --git a/.bin/umount-tree b/.bin/umount-tree index 340b61a..a831849 100755 --- a/.bin/umount-tree +++ b/.bin/umount-tree @@ -5,6 +5,11 @@ if [[ -z $1 ]] ; then exit 1 fi +prompt=true +case $1 in +-y) prompt=false; shift;; +esac + while [[ $# -gt 0 ]] ; do root=$1 @@ -21,8 +26,12 @@ fi echo "Unmounting: " printf '\t%s\n' ${mounts} -printf "OK? [y/N] " -read v +if ${prompt} ; then + printf "OK? [y/N] " + read v +else + v=y +fi [[ ${v} == "y" ]] && sudo umount -v ${mounts} done