]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
change static current phase to increment phase
authorBastian Dehn <hhaalo@arcor.de>
Fri, 24 Jun 2016 05:34:10 +0000 (07:34 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 27 Jun 2016 18:13:25 +0000 (20:13 +0200)
albentohandy.sh

index 70351d9157fc5f09ffb55f53e8ecd2668f91c8f4..b95178aca62cebf3321226f902e0a6f017e62b22 100755 (executable)
@@ -7,6 +7,7 @@ scriptpath="/media/smbdaten1/scripts"
 # musicpath is collection directory
 musicpath="/media/smbdaten1/musik-flac"
 parallelopts=":"
+curphase=1
 phase=3
 checksum=false
 
@@ -23,7 +24,7 @@ do
        case "$optname" in
        "c")
                checksum=true
-               phase=$(($phase + 1))
+               $((phase++))
                ;;
        "S")
                parallelopts="$OPTARG"
@@ -35,7 +36,7 @@ do
 done
 
 echo
-printf "Phase 01 von %02d: flac's in das Arbeitsverzeichnis %s verlinken\n" "$phase" "$work"
+printf "Phase %02d von %02d: flac's in das Arbeitsverzeichnis %s verlinken\n" $((curphase++)) $phase "$work"
 
 if [ ! -d $work ]
 then
@@ -49,16 +50,16 @@ do
 done
 
 echo
-printf "Phase 02 von %02d: flac -> mp3\n" "$phase"
+printf "Phase %02d von %02d: flac -> mp3\n" $((curphase++)) $phase
 find $work -name '*.flac' | sort | parallel --eta --progress --noswap -S $parallelopts $scriptpath/flactomp3v2.sh {}
 echo
-printf "Phase 03 von %02d: flac's und cover's loeschen\n" "$phase"
+printf "Phase %02d von %02d: flac's und cover's loeschen\n" $((curphase++)) $phase
 echo
 find $work -name '*.flac' | sort | xargs rm
 find $work -name 'cover*' | sort | xargs rm
 if [ $checksum == true ]
 then
-       printf "Phase 04 von %02d: erstelle sha256sum\n" "$phase"
+       printf "Phase %02d von %02d: erstelle sha256sum\n" $((curphase++)) $phase
        find $work -name '*.mp3' | sort | xargs sha256sum | sed "s=$work/==" >> $work/sha256sum
        echo
 fi