network: Allow passing custom options to dhcpcd

This is useful for debugging.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2022-12-01 17:22:54 +00:00
committed by Peter Müller
parent 33d2aa6d02
commit c6551e73c2

View File

@@ -59,8 +59,9 @@ dhcpcd_is_running() {
dhcpcd_start() {
# This function will start a dhcpcd on a speciefied device.
local device="$1"
shift
local dhcp_start=()
boot_mesg -n "Starting dhcpcd on the ${device} interface..."
@@ -84,6 +85,9 @@ dhcpcd_start() {
dhcp_start+=( "--static" "mtu=${RED_DHCP_FORCE_MTU}" )
fi
# Append any further command line options
dhcp_start+=( $@ )
# Start dhcpcd.
/sbin/dhcpcd "${dhcp_start[@]}" ${device} >/dev/null 2>&1
ret="$?"