Date: Wed, 8 Jun 2005 10:39:13 -0700 From: Brooks Davis <brooks@one-eyed-alien.net> To: Max Boyarov <max_b@tut.by> Cc: freebsd-current@freebsd.org Subject: Re: dhclient-exit-hooks Message-ID: <20050608173913.GB20036@odin.ac.hmc.edu> In-Reply-To: <86vf4pq931.fsf@tut.by> References: <86vf4pq931.fsf@tut.by>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Wed, Jun 08, 2005 at 04:20:02PM +0300, Max Boyarov wrote:
>
> After last upgrade to current my dhclient-exit-hooks don't work.
> I checked my configuration again, but I cant found any place in
> /sbin/dhclient-script that runs hooks. How can I now use
> dhclient-exit-hooks ?
We need to add support for exit hooks back to the script.a I think this
should do it:
Index: sbin/dhclient/dhclient-script
===================================================================
RCS file: /home/ncvs/src/sbin/dhclient/dhclient-script,v
retrieving revision 1.2
diff -u -p -r1.2 dhclient-script
--- sbin/dhclient/dhclient-script 7 Jun 2005 04:32:29 -0000 1.2
+++ sbin/dhclient/dhclient-script 8 Jun 2005 17:34:34 -0000
@@ -172,6 +172,16 @@ add_new_resolv_conf() {
return 1
}
+# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
+exit_with_hooks() {
+ exit_status=$1
+ if [ -f /etc/dhclient-exit-hooks ]; then
+ . /etc/dhclient-exit-hooks
+ fi
+ # probably should do something with exit status of the local script
+ exit $exit_status
+}
+
#
# Start of active code.
#
@@ -247,14 +257,14 @@ TIMEOUT)
fi
add_new_routes
if add_new_resolv_conf; then
- exit 0
+ exit_with_hooks 0
fi
fi
fi
ifconfig $interface inet -alias $new_ip_address $medium
delete_old_routes
- exit 1
+ exit_with_hooks 1
;;
esac
-exit 0
+exit_with_hooks 0
-- Brooks
--
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQFCpy0/XY6L6fI4GtQRAtYcAKDYTd2S1hTSR4jowJZHnQxcy6F7lQCfQEJQ
6Yc7gEb6DjbtltN0APNfnxg=
=D7ep
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050608173913.GB20036>
