refs #1161 adds some echos and tests

lgromero-tests
Luis Gerardo Romero Garcia 2024-11-19 10:06:07 +01:00
parent a2e12e6b6e
commit d720a057fc
1 changed files with 4 additions and 1 deletions

View File

@ -31,6 +31,7 @@ echo "qindel: ind ($ind)" 1>&2
# Buscar el dispositivo del índice.
dev=""
for f in /sys/class/net/*/uevent; do
echo "qindel: considering file ($f)" 1>&2
source $f
let aux=$IFINDEX-1
if [ "$ind" = "$INTERFACE" -o "$ind" = $aux ]; then echo "qindel: ind ($ind) == INTERFACE ($INTERFACE) -o ind ($ind) == aux ($aux), setting dev to ($INTERFACE)" 1>&2; dev="$INTERFACE"; fi
@ -632,7 +633,7 @@ ogConfigureLoopback()
#*/ ##
ogConfigureNetworking()
{
#echo "ogConfigureNetworking: Buscando interfaz a configurar DEVICE"
echo "qindel: ogConfigureNetworking: Buscando interfaz a configurar DEVICE"
if [ -n "${BOOTIF}" ]
then
#echo " variable BOOTIF exportada con pxelinux.0 con valor $BOOTIF"
@ -697,11 +698,13 @@ fi
# Activamos la interfaz antes de configurar.
ip address flush $DEVICE
ip link set dev $DEVICE up
echo "qindel: Carrier detected, configuring $DEVICE"
# Si no se detecta señal portadora volver a configurar.
sleep 1
CARRIER=$(cat /sys/class/net/${DEVICE}/carrier)
if [ "$CARRIER" != "1" ]
then
echo "qindel: Carrier not detected, trying ogConfigureNetworking again"
ogConfigureNetworking
fi