Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.34 KB | None | 0 0
  1. diff --git a/netif.d/dhcpcd b/netif.d/dhcpcd
  2. index a52cd2d..1541e5d 100644
  3. --- a/netif.d/dhcpcd
  4. +++ b/netif.d/dhcpcd
  5. @@ -1,35 +1,30 @@
  6.  #!/bin/sh
  7.  
  8. -netif_pre_up() {
  9. -       local dhcpcd="/sbin/dhcpcd"
  10. -       local pidfile="/var/run/dhcpcd-${interface}.pid"
  11. +DHCPCD="/sbin/dhcpcd"
  12. +PIDFILE="/var/run/dhcpcd-${interface}.pid"
  13.  
  14. -       if [ ! -f "${dhcpcd}" ]; then
  15. +netif_pre_up() {
  16. +       if [ ! -f "${DHCPCD}" ]; then
  17.                 echo "dhcpcd binary not found. Did you emerge net-misc/dhcpcd?"
  18.                 exit 1
  19.         fi
  20.  }
  21.  
  22.  netif_post_up() {
  23. -       local dhcpcd="/sbin/dhcpcd"
  24. -       local pidfile="/var/run/dhcpcd-${interface}.pid"
  25. -
  26. -       if [ -f "${pidfile}" ]; then
  27. +       if [ -f "${DHCPCD}" ]; then
  28.                 echo "There's a PID file for interface $interface. Aborting."
  29.                 exit 2
  30.         fi
  31.  
  32. -       $dhcpcd $interface
  33. +       $DHCPCD $interface
  34.  }
  35.  
  36.  netif_pre_down() {
  37. -       local pidfile="/var/run/dhcpcd-${interface}.pid"
  38. -
  39. -       if [ ! -f "${pidfile}" ]; then
  40. +       if [ ! -f "${PIDFILE}" ]; then
  41.                 echo "There's no PID file for interface ${interface}. Aborting."
  42.                 exit 3
  43.         fi
  44.  
  45. -       start-stop-daemon --stop --quiet --signal SIGHUP --pidfile "${pidfile}"
  46. +       start-stop-daemon --stop --quiet --signal SIGHUP --pidfile "${PIDFILE}"
  47.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement