]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
optimize load config file
authorBastian Dehn <hhaalo@arcor.de>
Sun, 13 Jul 2025 18:07:48 +0000 (20:07 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 13 Jul 2025 18:08:14 +0000 (20:08 +0200)
albentohandy

index a414ff81dc1840e2081983ad911b350eb7c7dab2..8b88e6b437744e368aae19dcefe981804c225647 100755 (executable)
@@ -346,13 +346,11 @@ CopyWorkDirToDestDir()
        cp --recursive $WORKDIR/* $DESTDIR
 }
 
-LoadConfig()
+load_config()
 {
-       # .albentohandy.conf: set MUSICPATH
-       if [ ! -f "$HOME/.albentohandy.conf" ]; then
-               echo "ERROR: $HOME/.albentohandy.conf does not exists"
-               exit 1
-       fi
+       [ -f "$HOME/.albentohandy.conf" ] \
+               || errlog "file $HOME/.albentohandy.conf does not exists" \
+               || return $?
 
        source $HOME/.albentohandy.conf
 }
@@ -505,7 +503,7 @@ main()
        MUSICPATH="/tmp/musikpath" # flac collection directory
 
        check_programms || return $?
-       LoadConfig
+       load_config || return $?
        SetDefaultVariables
 
        ReadArguments $*