update iptables rules
This commit is contained in:
parent
ee04442441
commit
113415945c
|
|
@ -169,9 +169,10 @@ function iptables_set(){
|
|||
echo "iptables start setting..."
|
||||
/sbin/service iptables status 1>/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
/etc/init.d/iptables status | grep '${shadowsocksport}' | grep 'ACCEPT' >/dev/null 2>&1
|
||||
/sbin/iptables -L -n | grep '${shadowsocksport}' | grep 'ACCEPT' >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
/sbin/iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport ${shadowsocksport} -j ACCEPT
|
||||
/sbin/iptables -I INPUT -m state --state NEW -m udp -p udp --dport ${shadowsocksport} -j ACCEPT
|
||||
/etc/init.d/iptables save
|
||||
/etc/init.d/iptables restart
|
||||
else
|
||||
|
|
@ -277,10 +278,10 @@ function install_shadowsocks_libev(){
|
|||
pre_install
|
||||
download_files
|
||||
config_shadowsocks
|
||||
if ! centosversion 7; then
|
||||
install
|
||||
if centosversion 6; then
|
||||
iptables_set
|
||||
fi
|
||||
install
|
||||
}
|
||||
|
||||
# Initialization step
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user