From fd2c9da55d0e19f2676eb5198c501fb3ccbfd914 Mon Sep 17 00:00:00 2001 From: 233boy Date: Sun, 8 Apr 2018 11:47:13 +0800 Subject: [PATCH] auto remove apache --- install.sh | 9 +++++++++ v2ray.sh | 18 +++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 695bf9d..96dec24 100644 --- a/install.sh +++ b/install.sh @@ -1627,6 +1627,15 @@ install() { try_enable_bbr [ $caddy ] && domain_check install_v2ray + if [[ $caddy || $v2ray_port == "80" ]]; then + if [[ $cmd == "yum" ]]; then + [[ $(pgrep "httpd") ]] && systemctl stop httpd + [[ $(command -v httpd) ]] && yum remove httpd -y + else + [[ $(pgrep "apache2") ]] && service apache2 stop + [[ $(command -v apache2) ]] && apt-get remove apache2* -y + fi + fi [ $caddy ] && install_caddy get_ip config diff --git a/v2ray.sh b/v2ray.sh index d864e1a..cd9838e 100644 --- a/v2ray.sh +++ b/v2ray.sh @@ -10,7 +10,7 @@ none='\e[0m' # Root [[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 -_version="v1.67" +_version="v1.68" cmd="apt-get" @@ -1306,6 +1306,13 @@ proxy_site_config() { } install_caddy() { + if [[ $cmd == "yum" ]]; then + [[ $(pgrep "httpd") ]] && systemctl stop httpd + [[ $(command -v httpd) ]] && yum remove httpd -y + else + [[ $(pgrep "apache2") ]] && service apache2 stop + [[ $(command -v apache2) ]] && apt-get remove apache2* -y + fi local caddy_tmp="/tmp/install_caddy/" local caddy_tmp_file="/tmp/install_caddy/caddy.tar.gz" if [[ $sys_bit == "i386" || $sys_bit == "i686" ]]; then @@ -3416,6 +3423,15 @@ config() { sed -i "31s/false/true/; 33s/$ssport/$new_ssport/; 35s/$sspass/$new_sspass/; 37s/$ssciphers/$new_ssciphers/" $backup fi + if [[ $v2ray_port == "80" ]]; then + if [[ $cmd == "yum" ]]; then + [[ $(pgrep "httpd") ]] && systemctl stop httpd >/dev/null 2>&1 + [[ $(command -v httpd) ]] && yum remove httpd -y >/dev/null 2>&1 + else + [[ $(pgrep "apache2") ]] && service apache2 stop >/dev/null 2>&1 + [[ $(command -v apache2) ]] && apt-get remove apache2* -y >/dev/null 2>&1 + fi + fi do_service restart v2ray } _boom_() {