#!/bin/bash
service iptables status |awk '{print $5}' |grep -v s|grep -v 224.0.0.1 |grep -v 218.79.203.91|grep -v ^0 |grep -v 127|grep -v ^$ |grep -v 10.1 >/root/test.txt
sed -i '1,$s/^/all:/g'  /root/test.txt 
sort /etc/hosts.deny |uniq >> /root/test.txt 
cat /root/test.txt > /etc/hosts.deny
service fail2ban restart