From 066558c02bb5a016160df346e0045b5a0c3206a7 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 1 Dec 2012 13:39:30 -0500 Subject: [PATCH] -y: unmount w/out prompting --- .bin/umount-tree | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 -- 2.39.5