Subversion Repositories ALCASAR

Rev

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

Rev 806 Rev 808
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 806 2012-02-05 22:19:41Z richard $ 
2
#  $Id: alcasar.sh 808 2012-02-06 21:09:27Z franck $ 
3
 
3
 
4
# alcasar.sh
4
# alcasar.sh
5
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
5
# by Franck BOUIJOUX, Pascal LEVANT and 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 110... Line 110...
110
# We test the Ethernet links state
110
# We test the Ethernet links state
111
	for i in $EXTIF $INTIF
111
	for i in $EXTIF $INTIF
112
	do
112
	do
113
		/sbin/ip link set $i up
113
		/sbin/ip link set $i up
114
		sleep 3
114
		sleep 3
115
		if [ "`/usr/sbin/ethtool $i|grep Link|cut -d' ' -f3`" != "yes" ]
115
		CMD=`/usr/sbin/ethtool $i |grep Link | awk '{print $NF}'`
-
 
116
		CMD2=`/sbin/mii-tool $i | grep -i link | awk '{print $NF}'`
-
 
117
		if [ $CMD != "yes" ] && [ $CMD2 != "ok" ]
116
			then
118
			then
117
			if [ $Lang == "fr" ]
119
			if [ $Lang == "fr" ]
118
			then 
120
			then 
119
				echo "Échec"
121
				echo "Échec"
120
				echo "Le lien réseau de la carte $i n'est pas actif."
122
				echo "Le lien réseau de la carte $i n'est pas actif."
Line 1349... Line 1351...
1349
# activation du "chien de garde" (watchdog) toutes les 3'
1351
# activation du "chien de garde" (watchdog) toutes les 3'
1350
	cat << EOF > /etc/cron.d/alcasar-watchdog
1352
	cat << EOF > /etc/cron.d/alcasar-watchdog
1351
# activation du "chien de garde" (watchdog) toutes les 3'
1353
# activation du "chien de garde" (watchdog) toutes les 3'
1352
*/3 * * * * root $DIR_DEST_BIN/alcasar-watchdog.sh > /dev/null 2>&1
1354
*/3 * * * * root $DIR_DEST_BIN/alcasar-watchdog.sh > /dev/null 2>&1
1353
EOF
1355
EOF
-
 
1356
# activation du "chien de garde des services" (watchdog) toutes les 18'
-
 
1357
	cat << EOF > /etc/cron.d/alcasar-daemon-watchdog
-
 
1358
# activation du "chien de garde" (daemon-watchdog) toutes les 18'
-
 
1359
*/18 * * * * root $DIR_DEST_BIN/alcasar-daemon.sh > /dev/null 2>&1
-
 
1360
EOF
1354
# suppression des crons usagers
1361
# suppression des crons usagers
1355
	rm -f /var/spool/cron/*
1362
	rm -f /var/spool/cron/*
1356
} # End cron
1363
} # End cron
1357
 
1364
 
1358
##################################################################
1365
##################################################################