Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2289 → Rev 2290

/alcasar.sh
224,7 → 224,7
fi
if [ ! -d /var/log/netflow/porttracker ]
then
# Test of free space on /var
# Test free space on /var
free_space=`df -BG --output=avail /var|tail -1|tr -d [:space:]G`
if [ $free_space -lt 10 ]
then
235,14 → 235,13
exit 0
fi
fi
###########################################################################################
# Comparaison des interfaces et des fichiers d'interface présents
# Suppression des fichiers d'interface si l'interface n'est plus présente
# Exemple: Cas d'un dongle USB GSM qui crée une interface réseau
 
if [ $Lang == "fr" ]
then echo -n "Tests des paramètres réseau : "
else echo -n "Network parameters tests : "
fi
# Remove conf file if NIC is not plugged (ie : GSM/WIFI/Bt dongles)
cd /etc/sysconfig/network-scripts/
IF_INTERFACES=`ls ifcfg-*|grep -v "^lo"|cut -d"-" -f2|cut -d"*" -f1`
 
IF_INTERFACES=`ls ifcfg-*|cut -d"-" -f2|grep -v "^lo"|cut -d"*" -f1`
for i in $IF_INTERFACES
do
IP_INTERFACE=`/usr/sbin/ip link|grep $i`
257,15 → 256,12
fi
done
cd $DIR_INSTALL
###########################################################################################
if [ $Lang == "fr" ]
then echo -n "Tests des paramètres réseau : "
else echo -n "Network parameters tests : "
fi
# Test of Ethernet links state
DOWN_IF=`/usr/sbin/ip link|grep -v "^w"|grep "NO-CARRIER"|cut -d":" -f2|tr -d " "`
echo -n "."
# Test Ethernet NIC links state
DOWN_IF=`/usr/sbin/ip link|grep "NO-CARRIER"|cut -d":" -f2|tr -d " "|grep -v "^w"`
for i in $DOWN_IF
do
echo $i
if [ $Lang == "fr" ]
then
echo "Échec"
279,7 → 275,6
exit 0
done
echo -n "."
 
# Test EXTIF config files
PUBLIC_IP_MASK=`ip addr show $EXTIF|grep "inet "|cut -d" " -f6`
PUBLIC_IP=`echo $PUBLIC_IP_MASK | cut -d"/" -f1`
308,8 → 303,7
exit 0
fi
echo -n "."
 
# Test if router is alive (Box FAI)
# Test if default GW is set on EXTIF (router or ISP provider equipment)
if [ `ip route list|grep $EXTIF|grep -c ^default` -ne "1" ] ; then
if [ $Lang == "fr" ]
then
324,7 → 318,7
exit 0
fi
echo -n "."
# On teste le lien vers le routeur par defaut
# Test if default GW is alive
arp_reply=`/usr/sbin/arping -b -I$EXTIF -c1 -w2 $PUBLIC_GATEWAY|grep response|cut -d" " -f2`
if [ $(expr $arp_reply) -eq 0 ]
then
331,17 → 325,17
if [ $Lang == "fr" ]
then
echo "Échec"
echo "Le routeur de site ou la Box Internet ($PUBLIC_GATEWAY) ne répond pas."
echo "Le routeur de sortie ou la Box Internet ($PUBLIC_GATEWAY) ne répond pas."
echo "Réglez ce problème puis relancez ce script."
else
echo "Failed"
echo "The Internet gateway doesn't answered"
echo "The Internet gateway or the ISP equipment ($PUBLIC_GATEWAY) doesn't answered."
echo "Resolv this problem, then restart this script."
fi
exit 0
fi
echo -n "."
# On teste la connectivité Internet
# Test Internet connectivity
rm -rf /tmp/con_ok.html
/usr/bin/curl www.google.fr -s -o /tmp/con_ok.html
if [ ! -e /tmp/con_ok.html ]
364,7 → 358,7
 
##################################################################
## Function "init" ##
## - Création du fichier "/root/ALCASAR_parametres.txt" ##
## - Création du fichier "/root/ALCASAR_parametres.tx ##
## - Installation et modification des scripts du portail ##
##################################################################
init ()