]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
add cleanup option
authorBastian Dehn <hhaalo@arcor.de>
Fri, 24 Jun 2016 18:22:43 +0000 (20:22 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 27 Jun 2016 18:14:02 +0000 (20:14 +0200)
it remove working directory after it is finish
ignore remove workdir without zipfile

albentohandy.sh

index c32a83264d3d98f0b9b6f008dd37af4b3328665c..720651dfaed5e9fef7ea4ba9dd7062c5b9810bb2 100755 (executable)
@@ -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