]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
add zip option
authorBastian Dehn <hhaalo@arcor.de>
Fri, 24 Jun 2016 17:20:17 +0000 (19:20 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 27 Jun 2016 18:13:59 +0000 (20:13 +0200)
albentohandy.sh

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