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
8 diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' live-boot-grml~/scripts/live live-boot-grml/scripts/live
9 --- live-boot-grml~/scripts/live 2011-05-03 17:03:57.483541293 +0200
10 +++ live-boot-grml/scripts/live 2011-05-03 17:03:57.576874626 +0200
16 + DNSSERVER="${ARGUMENT#*=}"
17 + if echo "${DNSSERVER}" | grep -q , ; then
18 + DNSSERVER1="${DNSSERVER%,*}"
19 + DNSSERVER2="${DNSSERVER#*,}"
20 + export DNSSERVER1 DNSSERVER2
22 + DNSSERVER1="$DNSSERVER"
30 diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' live-boot-grml~/scripts/live-bottom/23networking_grml live-boot-grml/scripts/live-bottom/23networking_grml
31 --- live-boot-grml~/scripts/live-bottom/23networking_grml 2011-05-03 17:03:57.426874629 +0200
32 +++ live-boot-grml/scripts/live-bottom/23networking_grml 2011-05-03 17:05:11.820206602 +0200
35 # prepare a new /etc/network/interfaces file (and, possibly, a new /etc/resolv.conf)
36 IFFILE="/root/etc/network/interfaces"
37 -RESOLVCONF="/root/etc/resolv.conf"
38 +if [ -L /root/etc/resolv.conf ] ; then
39 + # assume we have resolvconf
40 + RESOLVCONF=/root/etc/resolvconf/resolv.conf.d/base
42 + RESOLVCONF="/root/etc/resolv.conf"
45 # config for loopback networking
53 +if [ -n "$DNSSERVER1" ]
55 + # disable any existing entries
56 + if [ -r $RESOLVCONF ]
58 + sed -i 's/nameserver/# nameserver/' $RESOLVCONF
60 + for i in $DNSSERVER1 $DNSSERVER2
62 + echo "nameserver $i" >> $RESOLVCONF