From 9170fc358b4e4e72fefd440a61057d1303594422 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 15 Aug 2017 21:03:27 +0000 Subject: [PATCH] wireless: Allow setting the channel when creating a device Signed-off-by: Michael Tremer --- src/functions/functions.wireless | 9 +++++++++ 1 file changed, 9 insertions(+) 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} } -- 2.47.3