summaryrefslogtreecommitdiffstats
path: root/sbin/dhclient
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2005-06-10 03:41:18 +0000
committerbrooks <brooks@FreeBSD.org>2005-06-10 03:41:18 +0000
commita3df0b223791d56229d079433841873c5d4353aa (patch)
tree214cdbe45e408be696d7c21b7ec24bfe945eaba1 /sbin/dhclient
parent2d109601cbaeb90e93aad0948a9367a78f196f9d (diff)
downloadFreeBSD-src-a3df0b223791d56229d079433841873c5d4353aa.zip
FreeBSD-src-a3df0b223791d56229d079433841873c5d4353aa.tar.gz
Add support for /etc/dhclient-enter-hooks to match /etc/dhclient-exit-hooks.
Diffstat (limited to 'sbin/dhclient')
-rw-r--r--sbin/dhclient/dhclient-script11
1 files changed, 11 insertions, 0 deletions
diff --git a/sbin/dhclient/dhclient-script b/sbin/dhclient/dhclient-script
index 46974fb..384e8f4 100644
--- a/sbin/dhclient/dhclient-script
+++ b/sbin/dhclient/dhclient-script
@@ -186,6 +186,17 @@ exit_with_hooks() {
# Start of active code.
#
+# Invoke the local dhcp client enter hooks, if they exist.
+if [ -f /etc/dhclient-enter-hooks ]; then
+ exit_status=0
+ . /etc/dhclient-enter-hooks
+ # allow the local script to abort processing of this state
+ # local script must set exit_status variable to nonzero.
+ if [ $exit_status -ne 0 ]; then
+ exit $exit_status
+ fi
+fi
+
if [ -x $NETSTAT ]; then
if_defaulroute=`$NETSTAT -rn | $GREP "^default" | $AWK '{print $6}'`
else
OpenPOWER on IntegriCloud