From 3df883dc63d5ce4299cd8d56ae62c670ccff2ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Wed, 29 Apr 2026 13:14:33 +0200 Subject: [PATCH] Make use of config.d/configure.conf file for first setup --- system_setup/setup_system.inc.sh | 24 ++++++++++++++++-------- system_setup/sync_client_software.sh | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/system_setup/setup_system.inc.sh b/system_setup/setup_system.inc.sh index 777a9b5..98c0137 100755 --- a/system_setup/setup_system.inc.sh +++ b/system_setup/setup_system.inc.sh @@ -15,15 +15,23 @@ # fi # return 0 #} -if [ ! -f $(dirname "$0")/../config/setup_system.conf ]; then - echo "System configuration not found. Please make a copy of setup_system.conf.dist, name it setup_system.conf and check the settings in it before running." - echo "Press any key to continue" && read -n 1 -s -r && exit 1 -fi -source $(dirname "$0")/../config/setup_system.conf -#Parse additional client-configs -if [[ `ls -1 $(dirname "$0")/../config.d/*.conf 2>/dev/null | wc -l ` -gt 0 ]]; then - source $(dirname "$0")/../config.d/*.conf +#Check for configure.conf - used for frist setup of system +if [[ -f $(dirname "$0")/../config.d/configure.conf ]]; then + echo "System in configure-mode. Will use $(dirname "$0")/../config.d/configure.conf for setup." + source $(dirname "$0")/../config.d/configure.conf +else + #Load default system setup file + if [[ ! -f $(dirname "$0")/../config/setup_system.conf ]]; then + echo "System configuration not found. Please make a copy of setup_system.conf.dist, name it setup_system.conf and check the settings in it before running." + echo "Press any key to continue" && read -n 1 -s -r && exit 1 + fi + source $(dirname "$0")/../config/setup_system.conf + + #Parse additional client-configs + if [[ `ls -1 $(dirname "$0")/../config.d/*.conf 2>/dev/null | wc -l ` -gt 0 ]]; then + source $(dirname "$0")/../config.d/*.conf + fi fi #Check if the Data- Directory is encrypted diff --git a/system_setup/sync_client_software.sh b/system_setup/sync_client_software.sh index 968bc2f..d5921f4 100755 --- a/system_setup/sync_client_software.sh +++ b/system_setup/sync_client_software.sh @@ -72,6 +72,24 @@ if [[ ! -z "${DISTCONFIGPATH_SRC}" ]]; then fi echo "Sucessfully synced." echo "" + + # Check, if we are in configure-mode and if so, remove the file and reread the now new synced configuration + if [ -f $(dirname "$0")/../config.d/configure.conf ]; then + #Check if configuration was obtained by sync + if [ -f $(dirname "$0")/../config/setup_system.conf ]; then + echo "Existing configuration found in Repository, removing configure-mode and reread the configuration." + rm -f $(dirname "$0")/../config.d/configure.conf.bak >/dev/null + mv $(dirname "$0")/../config.d/configure.conf $(dirname "$0")/../config.d/configure.conf.bak + source $(dirname "$0")/../config/setup_system.conf + else + echo "System is in configure-mode and configuration repository was found and synced, but still not configuration was found" + echo "checking file $(dirname "$0")/../config/setup_system.conf" + echo "" + echo "Please make a inital copy of config/setup_system.conf.dist to config/setup_system.conf and check all settings there." + echo "Then rerun the logon script to sync the file to your repository." + echo "Press any key to continue" && read -n 1 -s -r && exit 1 + fi + fi fi #Check if Repository is defined if [ "${CLIENT_SOFTWARE_DST}." == "." ]; then