From 48613ad5f5e8b28b82afba0e1caf983757683c4e Mon Sep 17 00:00:00 2001 From: cschantz Date: Tue, 17 Feb 2026 19:06:38 -0500 Subject: [PATCH] Add color codes and validation to wordpress-cron-manager.sh sub-menu - Add ${CYAN}...${NC} color codes to status check sub-menu options - Add ${RED}0)${NC} color code to cancel option - Implement input validation with retry loop for check_choice (0-2) - Add visual separator line before sub-menu prompt This completes menu uniformity standardization for this script. Co-Authored-By: Claude Haiku 4.5 --- .../wordpress/wordpress-cron-manager.sh | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/modules/website/wordpress/wordpress-cron-manager.sh b/modules/website/wordpress/wordpress-cron-manager.sh index 3421195..d589071 100755 --- a/modules/website/wordpress/wordpress-cron-manager.sh +++ b/modules/website/wordpress/wordpress-cron-manager.sh @@ -589,13 +589,26 @@ case "$choice" in # Check status echo "" echo "Check wp-cron status for:" - echo " 1) Specific domain" - echo " 2) Specific user" - echo " 0) Cancel" + echo -e " ${CYAN}1)${NC} Specific domain" + echo -e " ${CYAN}2)${NC} Specific user" + echo -e " ${RED}0)${NC} Cancel" echo "" - echo -n "Select [1]: " - read -r check_choice - check_choice="${check_choice:-1}" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + + # Validate check_choice input + while true; do + echo -n "Select [1]: " + read -r check_choice + check_choice="${check_choice:-1}" + + if ! [[ "$check_choice" =~ ^[0-2]$ ]]; then + echo "" + print_error "Invalid choice. Please enter 0, 1, or 2" + echo "" + continue + fi + break + done if [ "$check_choice" = "0" ]; then echo "Operation cancelled."