From effcd89f66e8d5daf213fbb44286b343b190e8c8 Mon Sep 17 00:00:00 2001 From: winlin Date: Thu, 9 Oct 2014 12:09:01 +0800 Subject: [PATCH] refine script. --- trunk/scripts/run.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/trunk/scripts/run.sh b/trunk/scripts/run.sh index 5fe698d4f..b54a378bf 100755 --- a/trunk/scripts/run.sh +++ b/trunk/scripts/run.sh @@ -39,10 +39,12 @@ if [[ `getenforce` != 'Disabled' ]]; then echo -e "${RED} 重启系统:sudo reboot${BLACK}"; fi -sudo /etc/init.d/iptables status >/dev/null 2>&1; -if [[ $? -ne 3 ]]; then - echo -e "${RED}请关闭防火墙:${BLACK}"; - echo -e "${RED} sudo /etc/init.d/iptables stop${BLACK}"; +if [[ -f /etc/init.d/iptables ]]; then + sudo /etc/init.d/iptables status >/dev/null 2>&1; + if [[ $? -ne 3 ]]; then + echo -e "${RED}请关闭防火墙:${BLACK}"; + echo -e "${RED} sudo /etc/init.d/iptables stop${BLACK}"; + fi fi echo -e "${GREEN}请在hosts中添加一行:${BLACK}"