From 8a4ee8ca505e5664b442c55a440daebcec3264a1 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Fri, 24 Jun 2016 20:22:43 +0200 Subject: [PATCH] add cleanup option it remove working directory after it is finish ignore remove workdir without zipfile --- albentohandy.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/albentohandy.sh b/albentohandy.sh index c32a832..720651d 100755 --- a/albentohandy.sh +++ b/albentohandy.sh @@ -11,6 +11,7 @@ curphase=1 phase=3 checksum=false mkzip=false +removework=false if [ ! -f albumlist ] then @@ -20,9 +21,12 @@ then exit fi -while getopts "z::cS:" optname +while getopts ":rz::cS:" optname do case "$optname" in + "r") + removework=true + ;; "z") mkzip=true zipname="$OPTARG" @@ -78,3 +82,7 @@ then cd $curpath echo fi +if [ $mkzip == true ] && [ $removework == true ] +then + rm -r $work +fi -- 2.47.3