diff --git a/scripts/03_generate_secrets.sh b/scripts/03_generate_secrets.sh index 3dc0d22..cff473e 100755 --- a/scripts/03_generate_secrets.sh +++ b/scripts/03_generate_secrets.sh @@ -91,7 +91,7 @@ fi # Prompt for the domain name while true; do echo "" - read -p $'Enter the primary domain name for your services (e.g., example.com): \n' DOMAIN + read -p "Enter the primary domain name for your services (e.g., example.com): " DOMAIN # Validate domain input if [[ -z "$DOMAIN" ]]; then @@ -105,7 +105,7 @@ while true; do fi echo "" - read -p "$(printf "Are you sure '%s' is correct? (y/N): \n" "$DOMAIN")" confirm_domain + read -p "Are you sure '$DOMAIN' is correct? (y/N): " confirm_domain if [[ "$confirm_domain" =~ ^[Yy]$ ]]; then break # Confirmed, exit loop else @@ -128,7 +128,7 @@ if [[ -n "${existing_env_vars[LETSENCRYPT_EMAIL]}" ]]; then else while true; do echo "" - read -p $'Email: \n' USER_EMAIL + read -p "Email: " USER_EMAIL # Validate email input if [[ -z "$USER_EMAIL" ]]; then @@ -142,7 +142,7 @@ else fi echo "" - read -p "$(printf "Are you sure '%s' is correct? (y/N): \n" "$USER_EMAIL")" confirm_email + read -p "Are you sure '$USER_EMAIL' is correct? (y/N): " confirm_email if [[ "$confirm_email" =~ ^[Yy]$ ]]; then break # Confirmed, exit loop else @@ -164,11 +164,11 @@ if [[ -v existing_env_vars[OPENAI_API_KEY] ]]; then # -v checks if variable is s else log_info "Found empty OpenAI API Key in .env. You can provide one now or leave empty." echo "" - read -p $'OpenAI API Key: \n' OPENAI_API_KEY # Allow update if it was empty + read -p "OpenAI API Key: " OPENAI_API_KEY # Allow update if it was empty fi else echo "" - read -p $'OpenAI API Key: \n' OPENAI_API_KEY + read -p "OpenAI API Key: " OPENAI_API_KEY fi # Ask if user wants to import ready-made workflow for n8n @@ -178,7 +178,7 @@ if [[ -n "${existing_env_vars[RUN_N8N_IMPORT]}" ]]; then log_info "Using existing RUN_N8N_IMPORT value from .env: $RUN_N8N_IMPORT" else echo "" - read -p $'Import workflows? (y/n): \n' import_workflow + read -p "Import workflows? (y/n): " import_workflow if [[ "$import_workflow" =~ ^[Yy]$ ]]; then RUN_N8N_IMPORT="true" else @@ -193,7 +193,7 @@ if [[ -n "${existing_env_vars[N8N_WORKER_COUNT]}" ]]; then N8N_WORKER_COUNT_CURRENT="${existing_env_vars[N8N_WORKER_COUNT]}" log_info "Found existing N8N_WORKER_COUNT in .env: $N8N_WORKER_COUNT_CURRENT" echo "" - read -p "$(printf "Do you want to change the number of n8n workers? Current: %s. (Enter new number, or press Enter to keep current): \n" "$N8N_WORKER_COUNT_CURRENT")" N8N_WORKER_COUNT_INPUT_RAW + read -p "Do you want to change the number of n8n workers? Current: $N8N_WORKER_COUNT_CURRENT. (Enter new number, or press Enter to keep current): " N8N_WORKER_COUNT_INPUT_RAW if [[ -z "$N8N_WORKER_COUNT_INPUT_RAW" ]]; then N8N_WORKER_COUNT="$N8N_WORKER_COUNT_CURRENT" log_info "Keeping N8N_WORKER_COUNT at $N8N_WORKER_COUNT." @@ -203,7 +203,7 @@ if [[ -n "${existing_env_vars[N8N_WORKER_COUNT]}" ]]; then N8N_WORKER_COUNT_TEMP="$((10#$N8N_WORKER_COUNT_INPUT_RAW))" # Sanitize (e.g. 01 -> 1) if [[ "$N8N_WORKER_COUNT_TEMP" -ge 1 ]]; then echo "" - read -p "$(printf "Update n8n workers to %s? (y/N): \n" "$N8N_WORKER_COUNT_TEMP")" confirm_change + read -p "Update n8n workers to $N8N_WORKER_COUNT_TEMP? (y/N): " confirm_change if [[ "$confirm_change" =~ ^[Yy]$ ]]; then N8N_WORKER_COUNT="$N8N_WORKER_COUNT_TEMP" log_info "N8N_WORKER_COUNT set to $N8N_WORKER_COUNT." @@ -223,14 +223,14 @@ if [[ -n "${existing_env_vars[N8N_WORKER_COUNT]}" ]]; then else while true; do echo "" - read -p $'Enter the number of n8n workers to run (e.g., 1, 2, 3; default is 1): \n' N8N_WORKER_COUNT_INPUT_RAW + read -p "Enter the number of n8n workers to run (e.g., 1, 2, 3; default is 1): " N8N_WORKER_COUNT_INPUT_RAW N8N_WORKER_COUNT_CANDIDATE="${N8N_WORKER_COUNT_INPUT_RAW:-1}" # Default to 1 if empty if [[ "$N8N_WORKER_COUNT_CANDIDATE" =~ ^0*[1-9][0-9]*$ ]]; then N8N_WORKER_COUNT_VALIDATED="$((10#$N8N_WORKER_COUNT_CANDIDATE))" if [[ "$N8N_WORKER_COUNT_VALIDATED" -ge 1 ]]; then echo "" - read -p "$(printf "Run %s n8n worker(s)? (y/N): \n" "$N8N_WORKER_COUNT_VALIDATED")" confirm_workers + read -p "Run $N8N_WORKER_COUNT_VALIDATED n8n worker(s)? (y/N): " confirm_workers if [[ "$confirm_workers" =~ ^[Yy]$ ]]; then N8N_WORKER_COUNT="$N8N_WORKER_COUNT_VALIDATED" log_info "N8N_WORKER_COUNT set to $N8N_WORKER_COUNT." diff --git a/scripts/apply_update.sh b/scripts/apply_update.sh index 00cd053..f572957 100755 --- a/scripts/apply_update.sh +++ b/scripts/apply_update.sh @@ -41,7 +41,7 @@ $COMPOSE_CMD pull || { log_error "Failed to pull Docker images. Check network co # Ask user about n8n import and modify .env file if [ -f "$ENV_FILE" ]; then echo "" - read -p $'Import n8n workflow? (y/n). Enter \'n\' if you did it already: \n' import_choice + read -p "Import n8n workflow? (y/n). Enter 'n' if you did it already: " import_choice case "$import_choice" in [yY] | [yY][eE][sS] ) # Use a temporary file for sed portability @@ -64,7 +64,7 @@ if [ -f "$ENV_FILE" ]; then CURRENT_WORKER_COUNT=$(grep "^N8N_WORKER_COUNT=" "$ENV_FILE" | cut -d'=' -f2 | tr -d '"') log_info "Current n8n worker count: $CURRENT_WORKER_COUNT" echo "" - read -p "$(printf "Enter new n8n worker count (leave empty to keep current: %s): \n" "$CURRENT_WORKER_COUNT")" new_worker_count_raw + read -p "Enter new n8n worker count (leave empty to keep current: $CURRENT_WORKER_COUNT): " new_worker_count_raw if [[ -n "$new_worker_count_raw" ]]; then # Validate input: must be a positive integer @@ -88,7 +88,7 @@ if [ -f "$ENV_FILE" ]; then log_warning "N8N_WORKER_COUNT line not found in $ENV_FILE. Cannot update worker count during this update." # Optionally, prompt user to add it if needed: # echo "" - # read -p $'N8N_WORKER_COUNT line not found. Add it now? (Enter number, or leave empty to skip): \n' add_worker_count + # read -p "N8N_WORKER_COUNT line not found. Add it now? (Enter number, or leave empty to skip): " add_worker_count # if [[ "$add_worker_count" =~ ^[1-9][0-9]*$ ]]; then # echo "N8N_WORKER_COUNT="$add_worker_count"" >> "$ENV_FILE" # log_info "Added N8N_WORKER_COUNT=$add_worker_count to $ENV_FILE."