#!/bin/bash
#Powered by blog.slogra.com
port=`iptables -vL|grep ssh|
linuxjishu/13830.html target=_blank class=infotextkey>awk '{split($NF,a,":");print a[2]}'|wc -l`
if [ $port = 1 ];then
echo "ok!"
else
/etc/init.d/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/init.d/iptables restart
fi
fi