From: Bastian Dehn Date: Fri, 24 Jun 2016 18:22:43 +0000 (+0200) Subject: add cleanup option X-Git-Tag: v1.0.0^2~153 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=8a4ee8ca505e5664b442c55a440daebcec3264a1;p=albentohandy.git add cleanup option it remove working directory after it is finish ignore remove workdir without zipfile --- 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