From ef2c6499bea692abd7bc48988f9c95a11ce16bac Mon Sep 17 00:00:00 2001 From: Thuan Bui Date: Mon, 28 Apr 2025 01:42:58 +0000 Subject: [PATCH] Add option to restart Caddy in the interactive menu --- src/lib/menu.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/menu.sh b/src/lib/menu.sh index 6ad88cd..a5af4ba 100644 --- a/src/lib/menu.sh +++ b/src/lib/menu.sh @@ -12,6 +12,7 @@ show_interactive_menu() { print_info " $0 stop - Stop running WordPress sites" print_info " $0 start - Start an installed WordPress sites" print_info " $0 restart - Restart an installed WordPress sites" + print_info " $0 restart caddy - Restart Caddy" print_info " $0 restart all - Restart all WordPress sites and Caddy" print_info " $0 delete - Delete a WordPress site" print_info " $0 delete all - Delete everything" @@ -661,6 +662,15 @@ restart_sites() { echo "All containers have been started." ;; + "caddy") + if [ -f "${CADDY_DIR}/compose.yaml" ]; then + echo "Restarting Caddy reverse proxy..." + docker compose -f "${CADDY_DIR}/compose.yaml" restart + else + echo "Caddy reverse proxy is not installed." + fi + ;; + *) # Restart specific site WP_PROJECT_DIR="${WORDPRESS_DIR}/${target}"