From: Bastian Dehn Date: Fri, 24 Jun 2016 17:20:17 +0000 (+0200) Subject: add zip option X-Git-Tag: v1.0.0^2~154 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=fae6ca74463ff543f87e2b826eb4c991bffe5e82;p=albentohandy.git add zip option --- diff --git a/albentohandy.sh b/albentohandy.sh index b95178a..c32a832 100755 --- a/albentohandy.sh +++ b/albentohandy.sh @@ -10,6 +10,7 @@ parallelopts=":" curphase=1 phase=3 checksum=false +mkzip=false if [ ! -f albumlist ] then @@ -19,12 +20,17 @@ then exit fi -while getopts ":cS:" optname +while getopts "z::cS:" optname do case "$optname" in + "z") + mkzip=true + zipname="$OPTARG" + phase=$((phase + 1)) + ;; "c") checksum=true - $((phase++)) + phase=$((phase + 1)) ;; "S") parallelopts="$OPTARG" @@ -63,3 +69,12 @@ then find $work -name '*.mp3' | sort | xargs sha256sum | sed "s=$work/==" >> $work/sha256sum echo fi +if [ $mkzip == true ] +then + printf "Phase %02d von %02d: erstelle handy.zip\n" $((curphase++)) $phase + curpath=$(pwd) + cd $work + 7z a -bd -mmt=off -mm=Copy $curpath/$zipname . + cd $curpath + echo +fi