summaryrefslogtreecommitdiff
path: root/usr.sbin/dhcp
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-01-11 03:24:41 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-01-11 03:24:41 +0000
commitdae50989c25c246202480f7c5f81d021f3f2c056 (patch)
tree9a9b104254e21d006d9f412d5f18574c4b9f63e6 /usr.sbin/dhcp
parent435da2b36fc029a78b14648cb8275ffc30984041 (diff)
save & restore resolv.conf when we can... krw ok
Diffstat (limited to 'usr.sbin/dhcp')
-rw-r--r--usr.sbin/dhcp/dhclient/scripts/dhclient-script9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/dhcp/dhclient/scripts/dhclient-script b/usr.sbin/dhcp/dhclient/scripts/dhclient-script
index f6eb192b60a..164bb02ed48 100644
--- a/usr.sbin/dhcp/dhclient/scripts/dhclient-script
+++ b/usr.sbin/dhcp/dhclient/scripts/dhclient-script
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $OpenBSD: dhclient-script,v 1.16 2004/01/09 07:49:07 deraadt Exp $
+# $OpenBSD: dhclient-script,v 1.17 2004/01/11 03:24:40 deraadt Exp $
#
# Copyright (c) 2003 Kenneth R Westerback <krw@openbsd.org>
#
@@ -117,6 +117,9 @@ add_new_resolv_conf() {
# is a symbolic link, take care to preserve the link and write
# the new data in the correct location.
+ if [ -f /etc/resolv.conf ]; then
+ cat /etc/resolv.conf > /etc/resolv.conf.save
+ fi
cat /etc/resolv.conf.std > /etc/resolv.conf
rm -f /etc/resolv.conf.std
@@ -188,7 +191,9 @@ EXPIRE|FAIL)
fi
# XXX Why add alias we just deleted above?
add_new_alias
- # XXX Delete resolv.conf as no longer relevant?
+ if [ -f /etc/resolv.conf.save ]; then
+ cat /etc/resolv.conf.save > /etc/resolv.conf
+ fi
;;
TIMEOUT)