From 935f4226187d000973d72c49a1a8436a37f1d81c Mon Sep 17 00:00:00 2001 From: Teddysun Date: Sun, 4 Sep 2016 00:31:35 +0900 Subject: [PATCH] Update: delete log file when uninstall & iptables set --- shadowsocks.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shadowsocks.sh b/shadowsocks.sh index ee54d4b..bfadaac 100644 --- a/shadowsocks.sh +++ b/shadowsocks.sh @@ -187,7 +187,7 @@ function firewall_set(){ if centosversion 6; then /etc/init.d/iptables status > /dev/null 2>&1 if [ $? -eq 0 ]; then - iptables -L -n | grep '${shadowsocksport}' > /dev/null 2>&1 + iptables -L -n | grep -i ${shadowsocksport} > /dev/null 2>&1 if [ $? -ne 0 ]; then iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport ${shadowsocksport} -j ACCEPT iptables -I INPUT -m state --state NEW -m udp -p udp --dport ${shadowsocksport} -j ACCEPT @@ -303,6 +303,7 @@ function uninstall_shadowsocks(){ rm -f /etc/shadowsocks.json rm -f /var/run/shadowsocks.pid rm -f /etc/init.d/shadowsocks + rm -f /var/log/shadowsocks.log if [ -f /usr/local/shadowsocks_install.log ]; then cat /usr/local/shadowsocks_install.log | xargs rm -rf fi