Skip to content

Commit

Permalink
[lede] Added less strict is_default_wifi check
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Mar 1, 2017
1 parent be4c825 commit 6bbbc75
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions openwisp-config/files/sbin/openwisp-remove-default-wifi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,19 @@ local standard_path = standard_prefix .. 'config/'
local standard = uci.cursor(standard_path)
local changed = false

standard:foreach('wireless', 'wifi-iface', function(section)
if section['.anonymous'] and
section.encryption == 'none' and
section.mode == 'ap' and
function is_default_wifi(section)
if section.encryption == 'none' and
section.mode == 'ap' and
section.network == 'lan' and
(section.ssid == 'LEDE' or section.ssid == 'OpenWrt')
then
return true
end
return false
end

standard:foreach('wireless', 'wifi-iface', function(section)
if is_default_wifi(section) then
standard:delete('wireless', section['.name'])
changed = true
end
Expand Down

0 comments on commit 6bbbc75

Please sign in to comment.