From 201e00bbac1ac4ab9740d07d3fb85f25e1dc4954 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Sat, 25 Jul 2020 03:04:02 -0600 Subject: [PATCH] dhcp: add support for dhcpcd --- executor-scripts/dhcp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/executor-scripts/dhcp b/executor-scripts/dhcp index a88927f..46a9b09 100755 --- a/executor-scripts/dhcp +++ b/executor-scripts/dhcp @@ -3,12 +3,19 @@ set -e determine_implementation() { + [ -x /sbin/dhcpcd ] && echo "dhcpcd" && return [ -x /sbin/udhcpc ] && echo "udhcpc" && return echo "???" } start() { case "$1" in + dhcpcd) + [ -z "$IF_HOSTNAME" ] && optargs="$optargs -h $IF_HOSTNAME" + [ -z "$IF_VENDOR" ] && optargs="$optargs -i $IF_VENDOR" + [ -z "$IF_CLIENT" ] && optargs="$optargs -i $IF_CLIENT" + [ -z "$IF_LEASETIME" ] && optargs="$optargs -l $IF_LEASETIME" + /sbin/dhcpcd $optargs $IFACE udhcpc) /sbin/udhcpc -b -R -p /var/run/udhcpc.$IFACE.pid -i $IFACE ;; @@ -20,6 +27,9 @@ start() { stop() { case "$1" in + dhcpcd) + /sbin/dhcpcd -k $IFACE + ;; udhcpc) kill $(cat /var/lib/udhcpc.$IFACE.pid) ;;