Add option to restart Caddy in the interactive menu

This commit is contained in:
2025-04-28 01:42:58 +00:00
parent 60602b6782
commit ef2c6499be
+10
View File
@@ -12,6 +12,7 @@ show_interactive_menu() {
print_info " $0 stop <domain> - Stop running WordPress sites" print_info " $0 stop <domain> - Stop running WordPress sites"
print_info " $0 start <domain> - Start an installed WordPress sites" print_info " $0 start <domain> - Start an installed WordPress sites"
print_info " $0 restart <domain> - Restart an installed WordPress sites" print_info " $0 restart <domain> - 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 restart all - Restart all WordPress sites and Caddy"
print_info " $0 delete <domain> - Delete a WordPress site" print_info " $0 delete <domain> - Delete a WordPress site"
print_info " $0 delete all - Delete everything" print_info " $0 delete all - Delete everything"
@@ -661,6 +662,15 @@ restart_sites() {
echo "All containers have been started." 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 # Restart specific site
WP_PROJECT_DIR="${WORDPRESS_DIR}/${target}" WP_PROJECT_DIR="${WORDPRESS_DIR}/${target}"