diff --git a/src/core.sh b/src/core.sh index 31dd05e..a526c1c 100644 --- a/src/core.sh +++ b/src/core.sh @@ -894,7 +894,7 @@ uninstall() { ask string y "是否卸载 ${is_core_name}? [y]:" fi # 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 disable haproxy >/dev/null 2>&1 if [[ $(type -P apt-get) ]]; then @@ -905,6 +905,7 @@ uninstall() { elif [[ $(type -P yum) ]]; then yum remove -y haproxy >/dev/null 2>&1 fi + rm -rf /etc/haproxy fi # If Caddy is NOT being uninstalled (REPLY != '2'), we must restore Caddy back to port 443! if [[ $REPLY != '2' ]]; then