Subversion Repositories ALCASAR

Rev

Rev 786 | Rev 790 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 786 Rev 787
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-watchdog.sh 786 2012-01-02 22:50:31Z richard $
2
# $Id: alcasar-watchdog.sh 787 2012-01-02 23:05:28Z richard $
3
 
3
 
4
# alcasar-watchdog.sh
4
# alcasar-watchdog.sh
5
# by Richard REY
5
# by Richard REY
6
# This script is distributed under the Gnu General Public License (GPL)
6
# This script is distributed under the Gnu General Public License (GPL)
7
 
7
 
Line 108... Line 108...
108
		if [ -e $tmp_file ]; then
108
		if [ -e $tmp_file ]; then
109
			cat $tmp_file | while read noresponse
109
			cat $tmp_file | while read noresponse
110
			do
110
			do
111
				noresponse_ip=`echo $noresponse | cut -d" " -f1`
111
				noresponse_ip=`echo $noresponse | cut -d" " -f1`
112
				noresponse_mac=`echo $noresponse | cut -d" " -f2`
112
				noresponse_mac=`echo $noresponse | cut -d" " -f2`
113
				arp_reply=`/usr/sbin/arping -b -I$INTIF -s$PRIVATE_IP -c1 -w4 $noresponse_ip|grep response|cut -d" " -f2`
113
				arp_reply=`/usr/sbin/arping -b -I$INTIF -s$PRIVATE_IP -c1 -w4 $noresponse_ip|grep "Unicast reply"|wc -l`
114
				if [[ $(expr $arp_reply) -eq 0 ]]
114
				if [[ $(expr $arp_reply) -eq 0 ]]
115
	       				then
115
	       				then
116
					mac_allowed=`cat $macallowed_file |grep $noresponse_mac | wc -l`
116
					mac_allowed=`cat $macallowed_file |grep $noresponse_mac | wc -l`
117
					if [ $mac_allowed -eq 0 ]
117
					if [ $mac_allowed -eq 0 ]
118
						then
118
						then