# if there is (at least) an eth* network card then get the number of the first one,
# use it in this script and change interface in lxpanel network applet too
#pay attention, this could drive crazy someone who is tryng to understand
#why eth* number is not the one in /etc/network.conf
if grep -q eth /proc/net/dev ; then
INTERFACE=`cat /proc/net/dev | grep eth | cut -d : -f 1 | cut -d \ -f 3 | sed -n '1p'`
sed -i "s/iface=eth[0-9][0-9]*/iface=$INTERFACE/" /etc/lxpanel/default/panels/panel
fi
# if there is (at least) an eth* network card then get the number of the first one,
# use it in this script and change interface in lxpanel network applet too
#pay attention, this could drive crazy someone who is tryng to understand
#why eth* number is not the one in /etc/network.conf
if grep -q eth /proc/net/dev ; then
INTERFACE=`cat /proc/net/dev | grep eth | cut -d : -f 1 | cut -d \ -f 3 | sed -n '1p'`
sed -i "s/iface=eth[0-9][0-9]*/iface=$INTERFACE/" /etc/lxpanel/default/panels/panel
for i in `ls /home`; do
if [ -e /home/$i/.config/lxpanel/default/panels/panel ]; then
sed -i "s/iface=eth[0-9][0-9]*/iface=$INTERFACE/" /home/$i/.config/lxpanel/default/panels/panel ]
fi
done
fi
if [ -z "$2" ]; thenand before this row
. /etc/network.conf
else
. $2
fi
ifconfig $INTERFACE up, it will detect the first usable eth* , it will update lxpanel and take up the detected interface which obviously becomes the one actually active.
It looks like you're new here. If you want to get involved, click one of these buttons!