]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
albentohandy includes notify.sh
authorBastian Dehn <hhaalo@arcor.de>
Sat, 16 Jul 2016 14:05:37 +0000 (16:05 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 17 Jul 2016 07:35:59 +0000 (09:35 +0200)
albentohandy.sh

index 38af988c25710fc614d14f07d440c8d1f3d23fca..a1bf71c0f1a2215736332758c5ea417b4c1aa5ff 100755 (executable)
@@ -21,6 +21,13 @@ then
        printf "\nERROR\nflactomp3v2.sh do not found in %s\n" $scriptpath
        exit 1
 fi
+if [ ! -f $scriptpath/notify.sh ]
+then
+       printf "\nERROR\nnotify.sh do not found in %s\n" $scriptpath
+       exit 1
+else
+       source $scriptpath/notify.sh
+fi
 
 # set defaults
 albumlist="albumlist"
@@ -80,6 +87,12 @@ then
        mkdir $work
 fi
 
+openMail
+addInfo "<p>"
+currentDate
+addInfo "albentohandy.sh is started</p>"
+addInfo "<p>Foldende Alben wurden ausgew&auml;hlt:</p>"
+addInfo "<p>$(cat "$albumlist" | sed 's/$/<br>/')</p>"
 # make symlinks of original flac's
 printf "\nPhase %02d of %02d: create symlinks of flac's to working directory %s\n" $((curphase++)) $phase "$work"
 for i in $(cat "$albumlist")
@@ -89,8 +102,13 @@ done
 
 # convert flac to mp3
 # it is the longest phase
+addInfo "<p>"
+currentDate
+addInfo "flac -&gt; mp3 start<br>"
 printf "\nPhase %02d of %02d: flac -> mp3\n" $((curphase++)) $phase
 find $work -name '*.flac' | sort | parallel $BASEFILE --eta --progress --noswap -S $parallelopts $scriptpath/flactomp3v2.sh {}
+currentDate
+addInfo "flac -&gt; mp3 finished</p>"
 
 # removing flac and cover.jpg
 printf "\nPhase %02d of %02d: remove flac's and cover's\n\n" $((curphase++)) $phase
@@ -100,8 +118,13 @@ find $work -name 'cover*' | sort | xargs rm
 # create sha256sum in working directory
 if [ $checksum == true ]
 then
+       addInfo "<p>"
+       currentDate
+       addInfo "create sha256sum is start<br>"
        printf "Phase %02d of %02d: create sha256sum\n\n" $((curphase++)) $phase
        find $work -name '*.mp3' | sort | xargs sha256sum | sed "s=$work/==" >> $work/sha256sum
+       currentDate
+       addInfo "sha256sum is created</p>"
 fi
 
 # make zipfile in the current path
@@ -112,22 +135,32 @@ then
        then
                zipname="${zipname}.zip"
        fi
+       addInfo "<p>"
+       currentDate
+       addInfo "create $zipname start<br>"
        curpath=$(pwd)
        cd $work
        7z a -bd -mmt=off -mm=Copy $curpath/$zipname .
        cd $curpath
        printf "\n"
+       currentDate
+       addInfo "$zipname is created</p>"
 fi
 
 # copy work directory to destination folder
 if [ $cptodest == true ]
 then
        printf "Phase %02d of %02d: copy %s/ to destination %s\n\n" $((curphase++)) $phase $work $dest
+       addInfo "<p>"
+       currentDate
+       addInfo "copy from $work to $dest start<br>"
        if [ ! -d $dest ]
        then
                mkdir -p $dest
        fi
        cp -r $work/* $dest
+       currentDate
+       addInfo "copy from $work to $dest finished</p>"
 fi
 
 # delete the working directory
@@ -137,4 +170,10 @@ then
        rm -r $work
 fi
 
+addInfo "<p>"
+currentDate
+addInfo "send email</p>"
+closeMail
+sendEmail
+
 exit 0