iptables check every hour
Always use full path i.e /sbin/iptables for setting iptables in crontab
0 * * * * /bin/sh /bum/iptables_check.sh
#!/bin/bash
#
#Check if firewall is up
ISUP=`/sbin/iptables -L -n | grep DROP`
if [ -z "$ISUP" ]
then
echo "Firewall is down on `hostname`" | mail -s "Firewall Status" linux@drushti.in
fi
chmod 700 iptables_check.sh
0 * * * * /bin/sh /bum/iptables_check.sh
#!/bin/bash
#
#Check if firewall is up
ISUP=`/sbin/iptables -L -n | grep DROP`
if [ -z "$ISUP" ]
then
echo "Firewall is down on `hostname`" | mail -s "Firewall Status" linux@drushti.in
fi
chmod 700 iptables_check.sh
Comments
Post a Comment