From 0721550e9caa7601a77d43f0d3ee03424118a197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Wed, 29 Apr 2026 19:38:52 +0200 Subject: [PATCH] Add kickstart profile selection to configure.sh After server checks pass, present all ks_base_profiles/*.cfg files with their first-paragraph description and require the user to pick one. The selected profile is copied to ks.cfg in the repo root. Co-Authored-By: Claude Sonnet 4.6 --- system_setup/configure.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/system_setup/configure.sh b/system_setup/configure.sh index e51f426..b7653f0 100755 --- a/system_setup/configure.sh +++ b/system_setup/configure.sh @@ -103,6 +103,34 @@ while true; do continue fi + echo "" + echo "=== Select Kickstart Profile ===" + KS_DIR="${SCRIPTDIR}/../ks_base_profiles" + KS_DEST="${SCRIPTDIR}/../ks.cfg" + + mapfile -t KS_FILES < <(find "$KS_DIR" -maxdepth 1 -name "*.cfg" | sort) + if [[ ${#KS_FILES[@]} -eq 0 ]]; then + echo "No kickstart profiles found in ${KS_DIR}." + exit 1 + fi + + echo "" + for i in "${!KS_FILES[@]}"; do + desc=$(awk '/^$/{exit} {print}' "${KS_FILES[$i]}" \ + | sed 's/^#[[:space:]]*//' | tr '\n' ' ' | xargs) + printf " %d) %-36s %s\n" "$((i+1))" "$(basename "${KS_FILES[$i]}")" "$desc" + done + echo "" + + while true; do + read -rp "Select profile [1-${#KS_FILES[@]}]: " sel + [[ "$sel" =~ ^[0-9]+$ ]] && (( sel >= 1 && sel <= ${#KS_FILES[@]} )) && break + echo " Invalid selection, please enter a number between 1 and ${#KS_FILES[@]}." + done + + cp "${KS_FILES[$((sel-1))]}" "$KS_DEST" + echo "Copied '$(basename "${KS_FILES[$((sel-1))]}")' to ${KS_DEST}." + echo "" echo "=== Configuration complete ===" echo "All values have been configured and verified successfully."