]> git.pld-linux.org Git - packages/dhcp.git/blob - dhclient_hooks_d.patch
- updated to 4.4.3-P1
[packages/dhcp.git] / dhclient_hooks_d.patch
1 diff -dur dhcp-4.3.5.orig/client/scripts/linux dhcp-4.3.5/client/scripts/linux
2 --- dhcp-4.3.5.orig/client/scripts/linux        2016-09-27 21:16:50.000000000 +0200
3 +++ dhcp-4.3.5/client/scripts/linux     2017-08-07 13:26:44.000000000 +0200
4 @@ -69,24 +69,44 @@
5  
6  # Must be used on exit.   Invokes the local dhcp client exit hooks, if any.
7  exit_with_hooks() {
8 +  
9    exit_status=$1
10 -  if [ -f /etc/dhclient-exit-hooks ]; then
11 -    . /etc/dhclient-exit-hooks
12 -  fi
13 -# probably should do something with exit status of the local script
14 +
15 +  for i in /etc/dhclient-exit-hooks.d/*[!~,] ; do
16 +    [ -f "$i" ] || continue
17 +    # Don't run *.{rpmsave,rpmorig,rpmnew,swp} scripts
18 +    [ "${i%.rpmsave}" != "${i}" ] && continue
19 +    [ "${i%.rpmorig}" != "${i}" ] && continue
20 +    [ "${i%.rpmnew}" != "${i}" ] && continue
21 +    [ "${i%.swp}" != "${i}" ] && continue
22 +    [ "${i%,v}" != "${i}" ] && continue
23 +
24 +    . ${i}
25 +  done
26 +
27 +  # probably should do something with exit status of the local script
28    exit $exit_status
29  }
30  
31  # Invoke the local dhcp client enter hooks, if they exist.
32 -if [ -f /etc/dhclient-enter-hooks ]; then
33 -  exit_status=0
34 -  . /etc/dhclient-enter-hooks
35 +exit_status=0
36 +for i in /etc/dhclient-enter-hooks.d/*[!~,] ; do
37 +  [ -f "$i" ] || continue
38 +  # Don't run *.{rpmsave,rpmorig,rpmnew,swp} scripts
39 +  [ "${i%.rpmsave}" != "${i}" ] && continue
40 +  [ "${i%.rpmorig}" != "${i}" ] && continue
41 +  [ "${i%.rpmnew}" != "${i}" ] && continue
42 +  [ "${i%.swp}" != "${i}" ] && continue
43 +  [ "${i%,v}" != "${i}" ] && continue
44 +
45 +  . ${i}
46 +  
47    # allow the local script to abort processing of this state
48    # local script must set exit_status variable to nonzero.
49    if [ $exit_status -ne 0 ]; then
50      exit $exit_status
51    fi
52 -fi
53 +done
54  
55  ###
56  ### DHCPv4 Handlers
This page took 0.067425 seconds and 3 git commands to generate.