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
15 + DNSSERVER="${ARGUMENT#*=}"
16 + if echo "${DNSSERVER}" | grep -q , ; then
17 + DNSSERVER1="${DNSSERVER%,*}"
18 + DNSSERVER2="${DNSSERVER#*,}"
19 + export DNSSERVER1 DNSSERVER2
21 + DNSSERVER1="$DNSSERVER"
29 --- a/scripts/live-bottom/23networking_grml
30 +++ b/scripts/live-bottom/23networking_grml
33 # prepare a new /etc/network/interfaces file (and, possibly, a new /etc/resolv.conf)
34 IFFILE="/root/etc/network/interfaces"
35 -RESOLVCONF="/root/etc/resolv.conf"
36 +if [ -L /root/etc/resolv.conf ] ; then
37 + # assume we have resolvconf
38 + RESOLVCONF=/root/etc/resolvconf/resolv.conf.d/base
40 + RESOLVCONF="/root/etc/resolv.conf"
43 # config for loopback networking
51 +if [ -n "$DNSSERVER1" ]
53 + # disable any existing entries
54 + if [ -r $RESOLVCONF ]
56 + sed -i 's/nameserver/# nameserver/' $RESOLVCONF
58 + for i in $DNSSERVER1 $DNSSERVER2
60 + echo "nameserver $i" >> $RESOLVCONF