From d806dcbed22b71812dbbafe6681da8a4b74e0160 Mon Sep 17 00:00:00 2001 From: atrandys <37266675+atrandys@users.noreply.github.com> Date: Fri, 3 Apr 2020 17:57:18 +0800 Subject: [PATCH] Update trojan_wp.sh --- trojan_wp.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/trojan_wp.sh b/trojan_wp.sh index 2468700..cd0bd99 100644 --- a/trojan_wp.sh +++ b/trojan_wp.sh @@ -239,13 +239,6 @@ if [ -n "$Port443" ]; then red "=============================================================" exit 1 fi -CHECK=$(grep SELINUX= /etc/selinux/config | grep -v "#") -if [ "$CHECK" != "SELINUX=disabled" ]; then - green "检测到SELinux开启状态,添加放行80/443端口规则" - $systemPackage install -y policycoreutils-python >/dev/null 2>&1 - semanage port -m -t http_port_t -p tcp 80 - semanage port -m -t http_port_t -p tcp 443 -fi if [ "$release" == "centos" ]; then if [ -n "$(grep ' 6\.' /etc/redhat-release)" ] ;then red "===============" @@ -259,6 +252,13 @@ if [ "$release" == "centos" ]; then red "===============" exit fi + CHECK=$(grep SELINUX= /etc/selinux/config | grep -v "#") + if [ "$CHECK" != "SELINUX=disabled" ]; then + green "检测到SELinux开启状态,添加放行80/443端口规则" + yum install -y policycoreutils-python >/dev/null 2>&1 + semanage port -m -t http_port_t -p tcp 80 + semanage port -m -t http_port_t -p tcp 443 + fi firewall_status=`firewall-cmd --state` if [ "$firewall_status" == "running" ]; then green "检测到firewalld开启状态,添加放行80/443端口规则"