72,7 → 72,7 |
# ******* Network parameters - paramètres réseau ******* |
HOSTNAME="alcasar" # default hostname |
DOMAIN="localdomain" # default local domain |
EXTIF=`/sbin/ip route|grep default|cut -d" " -f5` # EXTIF is connected to the ISP broadband modem/router (In France : Box-FAI) |
EXTIF=`/sbin/ip route|grep default|cut -d" " -f5` # EXTIF is connected to the ISP broadband modem/router (In France : Box-FAI) |
INTIF=`/sbin/ip link|grep '^[[:digit:]]:'|grep -v "lo\|$EXTIF"|cut -d" " -f2|tr -d ":"` # INTIF is connected to the consultation network |
MTU="1500" |
ETHTOOL_OPTS='"autoneg off speed 100 duplex full"' |
131,7 → 131,7 |
then |
rm -f /tmp/alcasar-conf* |
else |
# Create a backup of running version importants files |
# Create a backup of running importants files |
$DIR_SCRIPTS/alcasar-conf.sh --create |
mode="update" |
fi |
206,11 → 206,30 |
then echo -n "Tests des paramètres réseau : " |
else echo -n "Network parameters tests : " |
fi |
# We test EXTIF config files |
|
# Test of Ethernet links state |
DOWN_IF=`/sbin/ip link|grep "NO-CARRIER"|cut -d":" -f2|tr -d " "` |
for i in $DOWN_IF |
do |
if [ $Lang == "fr" ] |
then |
echo "Échec" |
echo "Le lien réseau de la carte $i n'est pas actif." |
echo "Assurez-vous que cette carte est bien connectée à un équipement (commutateur, A.P., etc.)" |
else |
echo "Failed" |
echo "The link state of $i interface is down." |
echo "Make sure that this network card is connected to a switch or an A.P." |
fi |
exit 0 |
done |
echo -n "." |
|
# Test EXTIF config files |
PUBLIC_IP=`grep IPADDR /etc/sysconfig/network-scripts/ifcfg-$EXTIF|cut -d"=" -f2` |
PUBLIC_GATEWAY=`grep GATEWAY /etc/sysconfig/network-scripts/ifcfg-$EXTIF|cut -d"=" -f2` |
if [ "$EXTIF" == "" ] || [ `echo $PUBLIC_IP|wc -c` -lt 7 ] || [ `echo $PUBLIC_GATEWAY|wc -c` -lt 7 ] |
then |
if [ `echo $PUBLIC_IP|wc -c` -lt 7 ] || [ `echo $PUBLIC_GATEWAY|wc -c` -lt 7 ] |
then |
if [ $Lang == "fr" ] |
then |
echo "Échec" |
233,30 → 252,8 |
exit 0 |
fi |
echo -n "." |
# We test the Ethernet links state |
for i in $EXTIF $INTIF |
do |
/sbin/ip link set $i up |
sleep 3 |
CMD=`/usr/sbin/ethtool $i |egrep 'Link detected'| awk '{print $NF}'` |
CMD2=`/sbin/mii-tool $i | grep link | awk '{print $NF}'` |
if [ $CMD != "yes" ] && [ $CMD2 != "ok" ] |
then |
if [ $Lang == "fr" ] |
then |
echo "Échec" |
echo "Le lien réseau de la carte $i n'est pas actif." |
echo "Réglez ce problème puis relancez ce script." |
else |
echo "Failed" |
echo "The link state of $i interface id down." |
echo "Resolv this problem, then restart this script." |
fi |
exit 0 |
fi |
echo -n "." |
done |
# On teste la présence d'un routeur par défaut (Box FAI) |
|
# Test if router is alive (Box FAI) |
if [ `ip route list|grep -c ^default` -ne "1" ] ; then |
if [ $Lang == "fr" ] |
then |