Add functionality to restart Caddy from the interactive menu

This commit is contained in:
2025-04-28 01:50:44 +00:00
parent ef2c6499be
commit 68c2e18080
+8
View File
@@ -28,6 +28,9 @@ show_interactive_menu() {
if [ -d "$WORDPRESS_DIR" ] && [ -n "$(find "$WORDPRESS_DIR" -mindepth 1 -type d 2>/dev/null)" ]; then
print_menu_action "m" "Manage multiple sites"
fi
if [ -d "$CADDY_DIR" ] && [ -f "${CADDY_DIR}/compose.yaml" ]; then
print_menu_action "r" "Restart Caddy"
fi
print_menu_action "q" "Quit"
print_separator
@@ -40,6 +43,11 @@ show_interactive_menu() {
"n" | "N")
show_action_menu "new"
;;
"r" | "R")
restart_sites caddy
echo -e "${YELLOW}Caddy has been restarted${NC}"
show_interactive_menu
;;
"m" | "M")
show_multi_site_menu "${sites[@]}"
;;