Skip to content

Commit

Permalink
dhclient: T5724: run user hooks using run_hookdir
Browse files Browse the repository at this point in the history
User hooks are executed using run_hookdir (defined in the /sbin/dhclient-script script) instead of run-parts. That allows user hooks to modify variables set by the dhcp client (e.g., the new_routers variable to avoid the installation of the default routes).
  • Loading branch information
gavol authored Nov 11, 2023
1 parent c293213 commit 645a0e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/etc/dhcp/dhclient-enter-hooks.d/99-run-user-hooks
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
DHCP_PRE_HOOKS="/config/scripts/dhcp-client/pre-hooks.d/"
if [ -d "${DHCP_PRE_HOOKS}" ] ; then
run-parts "${DHCP_PRE_HOOKS}"
run_hookdir "${DHCP_PRE_HOOKS}"
fi
2 changes: 1 addition & 1 deletion src/etc/dhcp/dhclient-exit-hooks.d/98-run-user-hooks
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
DHCP_POST_HOOKS="/config/scripts/dhcp-client/post-hooks.d/"
if [ -d "${DHCP_POST_HOOKS}" ] ; then
run-parts "${DHCP_POST_HOOKS}"
run_hookdir "${DHCP_POST_HOOKS}"
fi

0 comments on commit 645a0e7

Please sign in to comment.