From: Roy Marples Date: Sat, 12 Jul 2008 17:14:45 +0000 (+0000) Subject: Allow a user defined enter and exit hook instead of just a single hook. X-Git-Tag: v4.0.2~194 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a7c3c8ed957d3e8ea4a6e92add49e21db0b003c;p=thirdparty%2Fdhcpcd.git Allow a user defined enter and exit hook instead of just a single hook. --- diff --git a/dhcpcd-run-hooks.8.in b/dhcpcd-run-hooks.8.in index a5452030..ef762d66 100644 --- a/dhcpcd-run-hooks.8.in +++ b/dhcpcd-run-hooks.8.in @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 21, 2008 +.Dd Jul 12, 2008 .Dt DHCPCD.SH 8 SMM .Sh NAME .Nm dhcpcd-run-hooks @@ -31,11 +31,13 @@ .Nm is used by .Xr dhcpcd 8 -to run any system or user defined hook scripts. +to run any system and user defined hook scripts. System hook scripts are found in .Pa @HOOKDIR@ -and the user defined hook is -.Pa @SYSCONFDIR@/dhcpcd.hook . +and the user defined hooks are +.Pa @SYSCONFDIR@/dhcpcd.enter-hook . +and +.Pa @SYSCONFDIR@/dhcpcd.exit-hook . The default install supplies hook scripts for configuring .Pa /etc/resolv.conf and the hostname. @@ -93,10 +95,11 @@ script to process them. When .Nm runs, it loads -.Pa @SYSCONFDIR@/dhcpcd.hook +.Pa @SYSCONFDIR@/dhcpcd.enter-hook and any scripts found in .Pa @HOOKDIR@ -in a lexical order. +in a lexical order and then finally +.Pa @SYSCONFDIR@/dhcpcd.exit-hook .Sh SEE ALSO .Xr dhcpcd 8 .Sh AUTHORS diff --git a/dhcpcd-run-hooks.in b/dhcpcd-run-hooks.in index 7fd8b091..bd7c64fa 100644 --- a/dhcpcd-run-hooks.in +++ b/dhcpcd-run-hooks.in @@ -22,8 +22,9 @@ restore_conf() # Thus, the user can create their dhcpcd.hook script to configure # /etc/resolv.conf how they want and stop the system scripts ever updating it. for hook in \ - @SYSCONFDIR@/dhcpcd.hook \ + @SYSCONFDIR@/dhcpcd.enter-hook \ @HOOKDIR@/* + @SYSCONFDIR@/dhcpcd.exit-hook \ do for skip in ${skip_hooks}; do case "${hook}" in