diff --git a/scripts/setup_wizard.sh b/scripts/setup_wizard.sh index da807af..de35a9d 100755 --- a/scripts/setup_wizard.sh +++ b/scripts/setup_wizard.sh @@ -102,8 +102,15 @@ install_unit() { local filename=$(basename "$template_url") local dest_path=/etc/systemd/system/"$filename" - log_info "Installing $filename..." + if [ -e "$dest_path" ]; then + get_input "CONFIRM_OVERWRITE" "Overwrite $dest_path? (y/n)" "y" "false" + if [[ "${CONFIRM_OVERWRITE,,}" != "y" ]]; then + echo "Skipping overwrite of ${dest_path}." + return + fi + fi + log_info "Installing $filename..." curl -sL $template_url | envsubst > "$dest_path" log_success "$filename installed to $dest_path" } @@ -138,7 +145,6 @@ else fi - # 1. Collect Inputs # Example: get_input "HOST_NAME" "Enter Hostname" "$(hostname)" "false"