1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 26_support_dns_bootoption.dpatch by Michael Prokop <mika@grml.org>
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Support dns bootoption. Usage examples: dns=8.8.8.8 / dns=8.8.8.8,1.2.3.4
11 echo "search ${DNSDOMAIN}" >> /etc/resolv.conf
14 - for i in ${IPV4DNS0} ${IPV4DNS1} ${IPV4DNS1}
15 + for i in ${IPV4DNS0} ${IPV4DNS1} ${IPV4DNS1} ${DNSSERVER1} ${DNSSERVER2}
17 if [ -n "$i" ] && [ "$i" != 0.0.0.0 ]
19 --- a/scripts/live-bottom/23networking_grml
20 +++ b/scripts/live-bottom/23networking_grml
23 # prepare a new /etc/network/interfaces file (and, possibly, a new /etc/resolv.conf)
24 IFFILE="/root/etc/network/interfaces"
25 -RESOLVCONF="/root/etc/resolv.conf"
26 +if [ -L /root/etc/resolv.conf ] ; then
27 + # assume we have resolvconf
28 + RESOLVCONF=/root/etc/resolvconf/resolv.conf.d/base
30 + RESOLVCONF="/root/etc/resolv.conf"
33 # config for loopback networking
41 +if [ -n "$DNSSERVER1" ]
43 + # disable any existing entries
44 + if [ -r $RESOLVCONF ]
46 + sed -i 's/nameserver/# nameserver/' $RESOLVCONF
48 + for i in $DNSSERVER1 $DNSSERVER2
50 + echo "nameserver $i" >> $RESOLVCONF
53 --- a/scripts/live-helpers
54 +++ b/scripts/live-helpers
60 + DNSSERVER="${ARGUMENT#*=}"
61 + if echo "${DNSSERVER}" | grep -q , ; then
62 + DNSSERVER1="${DNSSERVER%,*}"
63 + DNSSERVER2="${DNSSERVER#*,}"
64 + export DNSSERVER1 DNSSERVER2
66 + DNSSERVER1="$DNSSERVER"