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
9 ===================================================================
10 --- a/scripts/live 2011-07-24 22:08:11.000000000 +0200
11 +++ b/scripts/live 2011-07-24 22:08:13.000000000 +0200
17 + DNSSERVER="${ARGUMENT#*=}"
18 + if echo "${DNSSERVER}" | grep -q , ; then
19 + DNSSERVER1="${DNSSERVER%,*}"
20 + DNSSERVER2="${DNSSERVER#*,}"
21 + export DNSSERVER1 DNSSERVER2
23 + DNSSERVER1="$DNSSERVER"
31 Index: b/scripts/live-bottom/23networking_grml
32 ===================================================================
33 --- a/scripts/live-bottom/23networking_grml 2011-07-24 22:08:07.000000000 +0200
34 +++ b/scripts/live-bottom/23networking_grml 2011-07-24 22:08:13.000000000 +0200
37 # prepare a new /etc/network/interfaces file (and, possibly, a new /etc/resolv.conf)
38 IFFILE="/root/etc/network/interfaces"
39 -RESOLVCONF="/root/etc/resolv.conf"
40 +if [ -L /root/etc/resolv.conf ] ; then
41 + # assume we have resolvconf
42 + RESOLVCONF=/root/etc/resolvconf/resolv.conf.d/base
44 + RESOLVCONF="/root/etc/resolv.conf"
47 # config for loopback networking
55 +if [ -n "$DNSSERVER1" ]
57 + # disable any existing entries
58 + if [ -r $RESOLVCONF ]
60 + sed -i 's/nameserver/# nameserver/' $RESOLVCONF
62 + for i in $DNSSERVER1 $DNSSERVER2
64 + echo "nameserver $i" >> $RESOLVCONF