]> git.wh0rd.org Git - home.git/commitdiff
-y: unmount w/out prompting
authorMike Frysinger <vapier@gentoo.org>
Sat, 1 Dec 2012 18:39:30 +0000 (13:39 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sat, 1 Dec 2012 18:39:30 +0000 (13:39 -0500)
.bin/umount-tree

index 340b61abb036c6d17f46f3b9069a8c9c910eeed6..a831849982c654352ebb9d43b16fa6c746d4e282 100755 (executable)
@@ -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