]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
network: Allow passing custom options to dhcpcd
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 7 Sep 2022 15:54:07 +0000 (17:54 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 26 Oct 2022 13:59:00 +0000 (15:59 +0200)
This is useful for debugging.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/networking/functions.network

index eae4a7b7ca040422cd02e8497c77de6840c6d0a8..f246919decec4f5385e42eeeb958c2f5119e59d0 100644 (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="$?"