Subversion Repositories ALCASAR

Rev

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

Rev 360 Rev 363
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
# $Id: alcasar-watchdog.sh 360 2010-12-05 22:50:36Z richard $
2
# $Id: alcasar-watchdog.sh 363 2010-12-06 23:05:27Z richard $
3
# by rexy
3
# by rexy
4
# Ce script prévient les usagers de l'indisponibilité de l'accès Internet
4
# Ce script prévient les usagers de l'indisponibilité de l'accès Internet
5
# il déconnecte les usagers dont
5
# il déconnecte les usagers dont
6
# - les équipementis réseau ne répondent plus
6
# - les équipementis réseau ne répondent plus
7
# - les adresses MAC sont usurpées
7
# - les adresses MAC sont usurpées
Line 23... Line 23...
23
function ext_down_alert ()
23
function ext_down_alert ()
24
{
24
{
25
	case $EXT_DOWN in
25
	case $EXT_DOWN in
26
	"1")
26
	"1")
27
		logger "eth0 link down"
27
		logger "eth0 link down"
28
		/bin/sed -i "s?diagnostic =.*?diagnostic = eth0 link down?g" $Index_Page
28
		/bin/sed -i "s?diagnostic =.*?diagnostic = \"eth0 link down\";?g" $Index_Page
29
		;;
29
		;;
30
	"2")
30
	"2")
31
		logger "can't contact the default router"
31
		logger "can't contact the default router"
32
		/bin/sed -i "s?diagnostic =.*?diagnostic = can't contact the default router?g" $Index_Page
32
		/bin/sed -i "s?diagnostic =.*?diagnostic = \"can't contact the default router\";?g" $Index_Page
33
		;;
33
		;;
34
	"3")
34
	"3")
35
		logger "can't contact the Internet DNS"
35
		logger "can't contact the Internet DNS"
36
		/bin/sed -i "s?diagnostic =.*?diagnostic = can't contact the Internet DNS?g" $Index_Page
36
		/bin/sed -i "s?diagnostic =.*?diagnostic = \"can't contact the Internet DNS\";?g" $Index_Page
37
		;;
37
		;;
38
	esac
38
	esac
39
	net_pb=`cat /etc/dnsmasq.d/alcasar-dnsmasq.conf|grep "address=/#/"|wc -l`
39
	net_pb=`cat /etc/dnsmasq.d/alcasar-dnsmasq.conf|grep "address=/#/"|wc -l`
40
	if [ $net_pb != "1" ]
40
	if [ $net_pb != "1" ]
41
		then
41
		then