vi
#!/bin/bash
port=`iptables -vL|grep ssh|awk '{split($NF,a,":");print a[2]}'|wc -l`
if [ $port = 1 ];then
echo "ok!"
else
/etc//iptables start
sleep 2
port=`iptables -vL|grep ssh|awk '{split($NF,a,":");print a[2]}'|wc -l`
if [ $port = 1 ];then
echo "ok!"
else
/etc//iptables restart
fi
fi