235,12 → 235,35 |
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 |
|
cd /etc/sysconfig/network-scripts/ |
IF_INTERFACES=`ls ifcfg-*|grep -v "^lo"|cut -d"-" -f2|cut -d"*" -f1` |
|
for i in $IF_INTERFACES |
do |
IP_INTERFACE=`/usr/sbin/ip link|grep $i` |
if [ -z "$IP_INTERFACE" ] |
then |
rm -f ifcfg-$i |
|
if [ $Lang == "fr" ] |
then echo "Suppression : ifcfg-$i" |
else echo "Deleting : ifcfg-$i" |
fi |
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 "NO-CARRIER"|cut -d":" -f2|tr -d " "` |
DOWN_IF=`/usr/sbin/ip link|grep -v "^w"|grep "NO-CARRIER"|cut -d":" -f2|tr -d " "` |
for i in $DOWN_IF |
do |
if [ $Lang == "fr" ] |
494,6 → 517,26 |
# Wrtie the conf file |
echo "EXTIF=$EXTIF" >> $CONF_FILE |
echo "INTIF=$INTIF" >> $CONF_FILE |
######## Récupération des interfaces du ou des réseaux de consultation supplémentaires ################# |
INTERFACES=`/usr/sbin/ip link|grep '^[[:digit:]]:'|grep -v "^lo\|$EXTIF\|tun0"|cut -d " " -f2|tr -d ":"` |
|
for i in $INTERFACES |
do |
SUB=`echo ${i:0:2}` |
if [ $SUB = "wl" ] |
then WIFIF=$i |
elif [ "$i" != "$INTIF" ] && [ $SUB != "ww" ] |
then LANIF=$i |
fi |
done |
|
if [ -n "$WIFIF" ] |
then echo "WIFIF=$WIFIF" >> $CONF_FILE |
elif [ -n "$LANIF" ] |
then echo "LANIF=$LANIF" >> $CONF_FILE |
fi |
######################################################################################################### |
|
IP_SETTING=`grep BOOTPROTO /etc/sysconfig/network-scripts/ifcfg-$EXTIF|cut -d"=" -f2` # IP setting (static or dynamic) |
if [ $IP_SETTING == "dhcp" ] |
then |
594,6 → 637,35 |
ACCOUNTING=no |
USERCTL=no |
EOF |
######### Config WIFIF (consultation WIFI) ou LANIF (consultation LAN) in normal mode ################# |
if [ -n "$WIFIF" ] && [ "$WIFIF" != "$INTIF" ] |
then |
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-$WIFIF |
DEVICE=$WIFIF |
BOOTPROTO=static |
ONBOOT=yes |
NOZEROCONF=yes |
MII_NOT_SUPPORTED=yes |
IPV6INIT=no |
IPV6TO4INIT=no |
ACCOUNTING=no |
USERCTL=no |
EOF |
elif [ -n "$LANIF" ] |
then |
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-$LANIF |
DEVICE=$LANIF |
BOOTPROTO=static |
ONBOOT=yes |
NOZEROCONF=yes |
MII_NOT_SUPPORTED=yes |
IPV6INIT=no |
IPV6TO4INIT=no |
ACCOUNTING=no |
USERCTL=no |
EOF |
fi |
######################################################################################################### |
# Renseignement des fichiers hosts.allow et hosts.deny |
[ -e /etc/hosts.allow.default ] || cp /etc/hosts.allow /etc/hosts.allow.default |
cat <<EOF > /etc/hosts.allow |