From 2b9dd54f00d034bfadc2740855b695f01a8b1aeb Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 8 Aug 2017 04:05:20 +0200 Subject: [PATCH] gluon-client-bridge: fix 320-gluon-client-bridge-wireless coding style --- .../upgrade/320-gluon-client-bridge-wireless | 58 +++++++++---------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/320-gluon-client-bridge-wireless b/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/320-gluon-client-bridge-wireless index 058dc351..9d46acae 100755 --- a/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/320-gluon-client-bridge-wireless +++ b/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/320-gluon-client-bridge-wireless @@ -7,48 +7,46 @@ local uci = require('simple-uci').cursor() local function is_disabled(config, name) - local disabled - if uci:get('wireless', name) then - disabled = uci:get_bool('wireless', name, 'disabled') - else - disabled = config and config.disabled - end + local disabled + if uci:get('wireless', name) then + disabled = uci:get_bool('wireless', name, 'disabled') + else + disabled = config and config.disabled + end - return disabled + return disabled end local function configure_client(config, radio, index, suffix) - local name = 'client_' .. radio - local disabled = is_disabled(config, name) + local name = 'client_' .. radio + local disabled = is_disabled(config, name) - uci:delete('wireless', name) + uci:delete('wireless', name) - if not config then - return - end + if not config then + return + end - local macaddr = util.get_wlan_mac(uci, radio, index, 1) - if not macaddr then - return - end + local macaddr = util.get_wlan_mac(uci, radio, index, 1) + if not macaddr then + return + end - uci:section('wireless', 'wifi-iface', name, - { - device = radio, - network = 'client', - mode = 'ap', - ssid = config.ssid, - macaddr = macaddr, - ifname = suffix and 'client' .. suffix, - disabled = disabled or false, - } - ) + uci:section('wireless', 'wifi-iface', name, { + device = radio, + network = 'client', + mode = 'ap', + ssid = config.ssid, + macaddr = macaddr, + ifname = suffix and 'client' .. suffix, + disabled = disabled or false, + }) end local function configure_radio(radio, index, config) - local suffix = radio:match('^radio(%d+)$') + local suffix = radio:match('^radio(%d+)$') - configure_client(config.ap, radio, index, suffix) + configure_client(config.ap, radio, index, suffix) end util.iterate_radios(uci, configure_radio)