From 48803d89a489b5f08fbbdcfcf9f5c93e6ef01660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Sun, 3 May 2026 21:48:52 +0200 Subject: [PATCH] Configure: Take given REPO_URL and BRANCH to new installation --- system_setup/configure.sh | 8 ++++++++ system_setup/sync_client_software.sh | 19 ++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/system_setup/configure.sh b/system_setup/configure.sh index e9cba52..ac022dc 100755 --- a/system_setup/configure.sh +++ b/system_setup/configure.sh @@ -51,6 +51,14 @@ do_configure() { echo "=== System Configuration ===" echo "Press Enter to keep the current value, or type a new one." + # If other Repo infos are given, set them first + if [[ ! -z $REPO_URL ]]; then + set_conf_var "REPO_URL" "$REPO_URL" + fi + if [[ ! -z $REPO_BRANCH ]]; then + set_conf_var "REPO_BRANCH" "$REPO_BRANCH" + fi + source "$( dirname "$0" )/setup_system.inc.sh" VARS=("TLDOMAIN" "SERVERFQDN_IPA" "DOMAIN" "SERVERFQDN_NC" "IPAVAULTUSE" "IPAVAULTNAME" "DISTCONFIGPATH_SRC" "CLIENTADMINGROUP" ) for ELE in "${VARS[@]}" diff --git a/system_setup/sync_client_software.sh b/system_setup/sync_client_software.sh index 7e6f32c..b015552 100755 --- a/system_setup/sync_client_software.sh +++ b/system_setup/sync_client_software.sh @@ -88,7 +88,24 @@ if [[ ! -z "${DISTCONFIGPATH_SRC}" ]]; 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 + OLD_REPO_URL="$REPO_URL" + OLD_REPO_BRANCH="$REPO_BRANCH" + source $(dirname "$0")/setup_system.inc.sh + #Compare the Repository URLS after that + if [ "$REPO_URL" != "$OLD_REPO_URL" || "$REPO_BRANCH" != "$OLD_REPO_BRANCH" ]; then + echo "The Repository for installation was" + echo "$OLD_REPO_URL Branch $OLD_REPO_BRANCH" + echo "After reading the config, the Repository has changed to" + echo "$REPO_URL Branch $REPO_BRANCH" + echo + echo "Do you want to create a system specific configuration for the installation Repository, so that" + read -r -p "only this system will stay on the Repository for installation? [y/N]: " CREATE_REPO_CONF + if [[ "${CREATE_REPO_CONF,,}" == "y" ]]; then + echo "export REPO_URL=\"$OLD_REPO_URL\"" >$(dirname "$0")/../config.d/repo.conf + echo "export REPO_BRANCH=\"$OLD_REPO_BRANCH\"" >>$(dirname "$0")/../config.d/repo.conf + echo "Wrote new $(dirname "$0")/../config.d/repo.conf" + fi + fi 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"