Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/netif.d/dhcpcd b/netif.d/dhcpcd
- index a52cd2d..1541e5d 100644
- --- a/netif.d/dhcpcd
- +++ b/netif.d/dhcpcd
- @@ -1,35 +1,30 @@
- #!/bin/sh
- -netif_pre_up() {
- - local dhcpcd="/sbin/dhcpcd"
- - local pidfile="/var/run/dhcpcd-${interface}.pid"
- +DHCPCD="/sbin/dhcpcd"
- +PIDFILE="/var/run/dhcpcd-${interface}.pid"
- - if [ ! -f "${dhcpcd}" ]; then
- +netif_pre_up() {
- + if [ ! -f "${DHCPCD}" ]; then
- echo "dhcpcd binary not found. Did you emerge net-misc/dhcpcd?"
- exit 1
- fi
- }
- netif_post_up() {
- - local dhcpcd="/sbin/dhcpcd"
- - local pidfile="/var/run/dhcpcd-${interface}.pid"
- -
- - if [ -f "${pidfile}" ]; then
- + if [ -f "${DHCPCD}" ]; then
- echo "There's a PID file for interface $interface. Aborting."
- exit 2
- fi
- - $dhcpcd $interface
- + $DHCPCD $interface
- }
- netif_pre_down() {
- - local pidfile="/var/run/dhcpcd-${interface}.pid"
- -
- - if [ ! -f "${pidfile}" ]; then
- + if [ ! -f "${PIDFILE}" ]; then
- echo "There's no PID file for interface ${interface}. Aborting."
- exit 3
- fi
- - start-stop-daemon --stop --quiet --signal SIGHUP --pidfile "${pidfile}"
- + start-stop-daemon --stop --quiet --signal SIGHUP --pidfile "${PIDFILE}"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement