From 6072507d64d0e4120cc9d147bfbb1fb314fc74d0 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sat, 16 Jul 2016 16:05:37 +0200 Subject: [PATCH] albentohandy includes notify.sh --- albentohandy.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/albentohandy.sh b/albentohandy.sh index 38af988..a1bf71c 100755 --- a/albentohandy.sh +++ b/albentohandy.sh @@ -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 "

" +currentDate +addInfo "albentohandy.sh is started

" +addInfo "

Foldende Alben wurden ausgewählt:

" +addInfo "

$(cat "$albumlist" | sed 's/$/
/')

" # 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 "

" +currentDate +addInfo "flac -> mp3 start
" 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 -> mp3 finished

" # 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 "

" + currentDate + addInfo "create sha256sum is start
" 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

" fi # make zipfile in the current path @@ -112,22 +135,32 @@ then then zipname="${zipname}.zip" fi + addInfo "

" + currentDate + addInfo "create $zipname start
" curpath=$(pwd) cd $work 7z a -bd -mmt=off -mm=Copy $curpath/$zipname . cd $curpath printf "\n" + currentDate + addInfo "$zipname is created

" 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 "

" + currentDate + addInfo "copy from $work to $dest start
" if [ ! -d $dest ] then mkdir -p $dest fi cp -r $work/* $dest + currentDate + addInfo "copy from $work to $dest finished

" fi # delete the working directory @@ -137,4 +170,10 @@ then rm -r $work fi +addInfo "

" +currentDate +addInfo "send email

" +closeMail +sendEmail + exit 0 -- 2.47.3