]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
refactor load config check program
authorBastian Dehn <hhaalo@arcor.de>
Fri, 25 Sep 2026 07:18:14 +0000 (09:18 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 25 Sep 2026 07:18:14 +0000 (09:18 +0200)
src/albentohandy

index c19e75c18a107b6281a1369d5a458772de4faed1..687cd60cdb8504591f7289dc74a4c8ce529a9062 100755 (executable)
@@ -9,12 +9,15 @@ errlog()
        return $lastexit
 }
 
-main()
+check_programs()
 {
        command -v rsync > /dev/null \
                || errlog "command rsync not found" \
                || return $?
+}
 
+load_config()
+{
        CONFIG_FILE=${CONFIG_FILE:="$HOME/.albentohandy.conf"}
 
        [ -f "$CONFIG_FILE" ] \
@@ -22,5 +25,11 @@ main()
                || return $?
 }
 
+main()
+{
+       check_programs || return $?
+       load_config || return $?
+}
+
 [ "$TEST_MODE" == "ON" ] && return 0
 main "$@"
\ No newline at end of file