X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-bottom%2F23networking;h=603116fe0c353a5d4de69eb880db8f7695224e31;hb=f8bd742e3532bb40bb9689b6925fe6b1e1a53ba4;hp=c6ec9cc8c4b272aada8806d5e837e3df40d945bb;hpb=fdd8036ba32ad88e83a61191cc4597ae060355d2;p=live-boot-grml.git diff --git a/scripts/live-bottom/23networking b/scripts/live-bottom/23networking index c6ec9cc..603116f 100755 --- a/scripts/live-bottom/23networking +++ b/scripts/live-bottom/23networking @@ -33,14 +33,14 @@ log_begin_msg "Preconfiguring networking..." IFFILE="/root/etc/network/interfaces" -if [ "${STATICIP}" = "frommedia" -a -e "$IFFILE" ] +if [ "${STATICIP}" = "frommedia" -a -e "${IFFILE}" ] then # will use existent /etc/network/interfaces log_end_msg exit 0 fi -cat > "$IFFILE" << EOF +cat > "${IFFILE}" << EOF auto lo iface lo inet loopback @@ -60,7 +60,7 @@ then ifnetmask="$(echo ${ifline} | cut -f3 -d ',')" ifgateway="$(echo ${ifline} | cut -f4 -d ',')" -cat >> "$IFFILE" << EOF +cat >> "${IFFILE}" << EOF auto ${ifname} iface ${ifname} inet static address ${ifaddress} @@ -82,18 +82,21 @@ else fi # iterate the physical interfaces and add them to the interfaces list - for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan* - do - [ -e $interface ] || continue - i="$(basename $interface)" + if [ "${method}" != dhcp ] || [ ! -x /root/usr/sbin/NetworkManager ] + then + for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan* + do + [ -e ${interface} ] || continue + i="$(basename ${interface})" -cat >> "$IFFILE" << EOF -auto $i -iface $i inet $method +cat >> "${IFFILE}" << EOF +auto ${i} +iface ${i} inet ${method} EOF - done + done + fi if [ ! -f /root/etc/resolv.conf -a -f /netboot.config ] then @@ -125,16 +128,19 @@ EOF fi fi -#for i in eth0 eth1 eth2 ath0 wlan0 -#do -# grep -q "iface $i" $IFFILE && continue +#if [ ! -x /root/usr/sbin/NetworkManager ] +#then +# for i in eth0 eth1 eth2 ath0 wlan0 +# do +# grep -q "iface ${i}" ${IFFILE} && continue # -#cat >> "$IFFILE" << EOF -#auto $i -#iface $i inet dhcp +#cat >> "${IFFILE}" << EOF +#auto ${i} +#iface ${i} inet dhcp # #EOF # -#done +# done +#fi log_end_msg