From: Michael Tremer Date: Tue, 15 Aug 2017 21:03:27 +0000 (+0000) Subject: wireless: Allow setting the channel when creating a device X-Git-Tag: 010~262 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9170fc358b4e4e72fefd440a61057d1303594422;p=network.git wireless: Allow setting the channel when creating a device Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.wireless b/src/functions/functions.wireless index 581bdbfe..f219a1f7 100644 --- a/src/functions/functions.wireless +++ b/src/functions/functions.wireless @@ -31,6 +31,7 @@ wireless_create() { shift local address + local channel local phy local type="managed" @@ -39,6 +40,9 @@ wireless_create() { --address=*) address=$(cli_get_val ${1}) ;; + --channel=*) + channel=$(cli_get_val "${1}") + ;; --phy=*) phy=$(cli_get_val ${1}) phy=$(phy_get ${phy}) @@ -74,6 +78,11 @@ wireless_create() { log ERROR "could not create wireless device '${device}' (${type}): ${ret}" fi + # Set the channel + if isset channel; then + wireless_set_channel "${device}" "${channel}" || return $? + fi + return ${ret} }