From 5819e746a73f368795a85a8d82b5698db0f807de Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Fri, 25 Sep 2026 09:18:14 +0200 Subject: [PATCH] refactor load config check program --- src/albentohandy | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 -- 2.47.3