>> $workdir/sha256sum
}
-main() {
- WORK="$(pwd)/work.$$" # temporary working directory
- SCRIPTPATH="/usr/bin" # path to flactomp3v2 and notify.sh script
- MUSICPATH="/tmp/musikpath" # flac collection directory
+ExistsScripts() {
+ local readonly scriptdir="$1"
- # check exist config and scripts
+ # flactomp3v2: convert flac's to mp3
+ if [ ! -f $scriptdir/flactomp3v2 ]; then
+ printf "\nERROR\nflactomp3v2 do not found in %s\n" $scriptdir
+ exit 1
+ fi
+
+ # notify.sh: functions send email
+ if [ ! -f $scriptdir/notify.sh ]; then
+ printf "\nERROR\nnotify.sh do not found in %s\n" $scriptdir
+ exit 1
+ else
+ source $scriptdir/notify.sh
+ fi
+}
+
+LoadConfig() {
# .albentohandy.conf: set SCRIPTPATH and MUSICPATH
if [ -f $HOME/.albentohandy.conf ]; then
source $HOME/.albentohandy.conf
printf "\nERROR\n%s/.albentohandy.conf does not exists\n" $HOME
exit 1
fi
- # flactomp3v2: convert flac's to mp3
- if [ ! -f $SCRIPTPATH/flactomp3v2 ]; then
- printf "\nERROR\nflactomp3v2 do not found in %s\n" $SCRIPTPATH
- exit 1
- fi
- # notify.sh: functions send email
- if [ ! -f $SCRIPTPATH/notify.sh ]; then
- printf "\nERROR\nnotify.sh do not found in %s\n" $SCRIPTPATH
- exit 1
- else
- source $SCRIPTPATH/notify.sh
+
+ # in cluster you have to same bitrate and
+ # stereo mode of mp3's on every pc.
+ # read more about basefile in man parallel
+ if [ -f $HOME/.flactomp3v2.conf ]; then
+ BASEFILE="--basefile $HOME/.flactomp3v2.conf --cleanup"
fi
+}
+
+main() {
+ WORK="$(pwd)/work.$$" # temporary working directory
+ SCRIPTPATH="/usr/bin" # path to flactomp3v2 and notify.sh script
+ MUSICPATH="/tmp/musikpath" # flac collection directory
+
+ LoadConfig
+
+ ExistsScripts "$SCRIPTPATH"
# set defaults
albumlist="albumlist"
removework=false
cptodest=false
- # in cluster you have to same bitrate and
- # stereo mode of mp3's on every pc.
- # read more about basefile in man parallel
- if [ -f $HOME/.flactomp3v2.conf ]; then
- BASEFILE="--basefile $HOME/.flactomp3v2.conf --cleanup"
- fi
-
# read parameters
while getopts ":ci:m:S::rw:z:" optname; do
case "$optname" in