summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2012-09-18 18:27:56 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2012-09-18 18:27:56 +0000
commitf4d09f5280f576afbd8ed522d6001fc11ab9ddb0 (patch)
tree1b9d028fb424ff21ce719fcc9b35192e9bf8a3a9 /sbin
parentd03b362c95579db97fff337d691a7927d5ce8943 (diff)
Once resolv.conf.saved has been copied back as resolv.conf, delete it so
it isn't copied again the next time a dhclient goes away. Do the resolv.conf.saved restore for v6 as well since v6 goes through the trouble to create resolv.conf.saved. ok beck@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dhclient/dhclient-script7
1 files changed, 6 insertions, 1 deletions
diff --git a/sbin/dhclient/dhclient-script b/sbin/dhclient/dhclient-script
index 05d4638f68e..3298b1d3095 100644
--- a/sbin/dhclient/dhclient-script
+++ b/sbin/dhclient/dhclient-script
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $OpenBSD: dhclient-script,v 1.22 2011/04/09 19:53:00 krw Exp $
+# $OpenBSD: dhclient-script,v 1.23 2012/09/18 18:27:55 krw Exp $
#
# Copyright (c) 2003 Kenneth R Westerback <krw@openbsd.org>
#
@@ -220,6 +220,7 @@ EXPIRE|FAIL)
fi
if [ -f /etc/resolv.conf.save ]; then
cat /etc/resolv.conf.save > /etc/resolv.conf
+ rm -f /etc/resolv.conf.save
fi
;;
@@ -227,6 +228,10 @@ EXPIRE6|RELEASE6|STOP6)
if [ -n "$old_ip6_address" ]; then
ip6_delete_old_address
fi
+ if [ -f /etc/resolv.conf.save ]; then
+ cat /etc/resolv.conf.save > /etc/resolv.conf
+ rm -f /etc/resolv.conf.save
+ fi
;;
TIMEOUT)