curphase=1
phase=3
checksum=false
+mkzip=false
if [ ! -f albumlist ]
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"
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