#!/bin/bash
n=`iptables -nvL |grep ‘tcp dpt:22‘ |egrep -iE ‘DROP|REJECT‘|wc -l`
if [ $n -ge 1 ]
then
iptables -I INPUT -p tcp --dport 22 -j ACCEPT
fi
时间: 2024-10-15 12:35:01
#!/bin/bash
n=`iptables -nvL |grep ‘tcp dpt:22‘ |egrep -iE ‘DROP|REJECT‘|wc -l`
if [ $n -ge 1 ]
then
iptables -I INPUT -p tcp --dport 22 -j ACCEPT
fi