X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=components%2F9990-grml-networking.sh;h=49ceb811c217fc004be48f639c3b473d823f544a;hb=3f6c7f237005a22cc4108b016a9651fe59921b37;hp=f4031cdaf48ac519440ab377c5a030e505d5cf7d;hpb=0a99e046af49be786db4c61831178fa388617cea;p=live-boot-grml.git diff --git a/components/9990-grml-networking.sh b/components/9990-grml-networking.sh index f4031cd..49ceb81 100644 --- a/components/9990-grml-networking.sh +++ b/components/9990-grml-networking.sh @@ -67,10 +67,39 @@ for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*; d method="dhcp" fi - cat >> $IFFILE << EOF -allow-hotplug ${interface} + if [ -n "$VLANS" ] ; then + modprobe 8021q + + # vlan=: + for line in $(echo $VLANS | sed 's/ /\n'/) ; do + vlandev=${line#*:} + vlanid=${line%:*} + + if [ -n "$vlandev" ] && [ -n "$vlanid" ] ; then + case "$vlandev" in + "$interface") + vlan_raw_dev=$interface + interface="${vlandev}.${vlanid}" + ;; + esac + fi + done + fi + + if [ -n "$vlan_raw_dev" ] ; then + cat >> $IFFILE << EOF +auto ${interface} iface ${interface} inet ${method} + vlan-raw-device $vlan_raw_dev EOF + else + cat >> $IFFILE << EOF +auto ${interface} +iface ${interface} inet ${method} +EOF + fi + + unset vlandev vlanid vlan_raw_dev # unset variables to have clean state for next device # DNS for resolvconf and /etc/resolv.conf if [ -e "${netconfig}" ]; then @@ -104,14 +133,14 @@ EOF done # dns bootoption -if [ -n "$DNSSERVER1" ] +if [ -n "$DNSSERVERS" ] then # disable any existing entries if [ -r $RESOLVCONF ] then sed -i 's/nameserver/# nameserver/' $RESOLVCONF fi - for i in $DNSSERVER1 $DNSSERVER2 + for i in $DNSSERVERS do echo "nameserver $i" >> $RESOLVCONF done