projects
/
live-boot-grml.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix nodhcp option to actually force DHCP off
[live-boot-grml.git]
/
components
/
9990-netbase.sh
diff --git
a/components/9990-netbase.sh
b/components/9990-netbase.sh
index
496c3ff
..
04a4ae4
100755
(executable)
--- a/
components/9990-netbase.sh
+++ b/
components/9990-netbase.sh
@@
-16,7
+16,12
@@
Netbase ()
log_begin_msg "Preconfiguring networking"
IFFILE="/root/etc/network/interfaces"
log_begin_msg "Preconfiguring networking"
IFFILE="/root/etc/network/interfaces"
- DNSFILE="/root/etc/resolv.conf"
+ if [ -L /root/etc/resolv.conf ] ; then
+ # assume we have resolvconf
+ DNSFILE="/root/etc/resolvconf/resolv.conf.d/base"
+ else
+ DNSFILE="/root/etc/resolv.conf"
+ fi
if [ "${STATICIP}" = "frommedia" ] && [ -e "${IFFILE}" ]
then
if [ "${STATICIP}" = "frommedia" ] && [ -e "${IFFILE}" ]
then
@@
-75,7
+80,11
@@
EOF
fi
done
else
fi
done
else
- if [ -z "${NETBOOT}" ] || [ -n "${DHCP}" ]
+ if [ -n "${NODHCP}" ]
+ then
+ # force DHCP off
+ method="manual"
+ elif [ -z "${NETBOOT}" ] || [ -n "${DHCP}" ]
then
# default, dhcp assigned
method="dhcp"
then
# default, dhcp assigned
method="dhcp"
@@
-88,7
+97,7
@@
EOF
# iterate the physical interfaces and add them to the interfaces list and also add when ethdevice= called on cmdline
if [ "${method}" != dhcp ] || ([ ! -x /root/usr/sbin/NetworkManager ] && [ ! -x /root/usr/sbin/wicd ]) || [ ! -z "${ETHDEVICE}" ]
then
# iterate the physical interfaces and add them to the interfaces list and also add when ethdevice= called on cmdline
if [ "${method}" != dhcp ] || ([ ! -x /root/usr/sbin/NetworkManager ] && [ ! -x /root/usr/sbin/wicd ]) || [ ! -z "${ETHDEVICE}" ]
then
- for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*
+ for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*
/sys/class/net/en*
do
[ -e ${interface} ] || continue
i="$(basename ${interface})"
do
[ -e ${interface} ] || continue
i="$(basename ${interface})"
@@
-102,7
+111,7
@@
EOF
done
fi
done
fi
- if [ ! -f
/root/etc/resolv.conf ] || [ -z "$(cat /root/etc/resolv.conf
)" ]
+ if [ ! -f
"${DNSFILE}" ] || [ -z "$(cat ${DNSFILE}
)" ]
then
if [ -f /netboot.config ]
then
then
if [ -f /netboot.config ]
then
@@
-112,7
+121,7
@@
EOF
rc_search=$(cat netboot.config | awk '/domain/ { print $3 }')
rc_server0="$(cat netboot.config | awk '/dns0/ { print $5 }')"
rc_search=$(cat netboot.config | awk '/domain/ { print $3 }')
rc_server0="$(cat netboot.config | awk '/dns0/ { print $5 }')"
-cat >
/root/etc/resolv.conf
<< EOF
+cat >
$DNSFILE
<< EOF
search ${rc_search}
domain ${rc_search}
nameserver ${rc_server0}
search ${rc_search}
domain ${rc_search}
nameserver ${rc_server0}
@@
-120,12
+129,12
@@
EOF
rc_server1=$(cat netboot.config | awk '/dns0/ { print $8 }')
rc_server1=$(cat netboot.config | awk '/dns0/ { print $8 }')
- if [ "${rc_server1}" !
= "0.0.0.0" ]
+ if [ "${rc_server1}" != "0.0.0.0" ]
then
then
- echo "nameserver ${rc_server1}" >>
/root/etc/resolv.conf
+ echo "nameserver ${rc_server1}" >>
$DNSFILE
fi
fi
- cat
/root/etc/resolv.conf
>> /root/var/log/netboot.config
+ cat
$DNSFILE
>> /root/var/log/netboot.config
fi
fi
fi
fi
fi
fi