From: Bastian Dehn Date: Fri, 25 Sep 2026 07:18:14 +0000 (+0200) Subject: refactor load config check program X-Git-Tag: v1.0.0^2~7^2~36 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=5819e746a73f368795a85a8d82b5698db0f807de;p=albentohandy.git refactor load config check program --- diff --git a/src/albentohandy b/src/albentohandy index c19e75c..687cd60 100755 --- a/src/albentohandy +++ b/src/albentohandy @@ -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