fix: ensure HAProxy is completely removed and Caddy is restored during uninstall
Main / build (push) Waiting to run

This commit is contained in:
2026-07-08 13:26:44 +08:00
parent c1dd5bf640
commit fa34c74937
+2 -1
View File
@@ -894,7 +894,7 @@ uninstall() {
ask string y "是否卸载 ${is_core_name}? [y]:" ask string y "是否卸载 ${is_core_name}? [y]:"
fi fi
# Clean up HAProxy and restore Caddy before removing files # Clean up HAProxy and restore Caddy before removing files
if systemctl is-active --quiet haproxy >/dev/null 2>&1; then if [[ $(type -P haproxy) || -d /etc/haproxy ]]; then
systemctl stop haproxy >/dev/null 2>&1 systemctl stop haproxy >/dev/null 2>&1
systemctl disable haproxy >/dev/null 2>&1 systemctl disable haproxy >/dev/null 2>&1
if [[ $(type -P apt-get) ]]; then if [[ $(type -P apt-get) ]]; then
@@ -905,6 +905,7 @@ uninstall() {
elif [[ $(type -P yum) ]]; then elif [[ $(type -P yum) ]]; then
yum remove -y haproxy >/dev/null 2>&1 yum remove -y haproxy >/dev/null 2>&1
fi fi
rm -rf /etc/haproxy
fi fi
# If Caddy is NOT being uninstalled (REPLY != '2'), we must restore Caddy back to port 443! # If Caddy is NOT being uninstalled (REPLY != '2'), we must restore Caddy back to port 443!
if [[ $REPLY != '2' ]]; then if [[ $REPLY != '2' ]]; then