Commit af7dcfcf authored by rubo77's avatar rubo77
parent c6dc54f7
gluon-ssid-changer
==================
_This branch of the script contains the ssid-changer version for the gluon 2018.1.x branch. For the 2017.1.x release of Gluon use the branch "lede"._
This package adds a script to change the SSID to an Offline-SSID when there is
no connection to any gateway.
This SSID can be generated from the nodes hostname with the first
......
if need_table('ssid_changer', nil, false) then
need_boolean('ssid_changer.enabled', false)
need_number('ssid_changer.switch_timeframe', false)
need_number('ssid_changer.first', false)
need_string('ssid_changer.prefix', false)
need_string('ssid_changer.suffix', false)
if need_boolean('ssid_changer.tq_limit_enabled', false) then
need_number('ssid_changer.tq_limit_max', false)
need_number('ssid_changer.tq_limit_min', false)
end
need_boolean({'ssid_changer', 'enabled'}, false)
need_number({'ssid_changer', 'switch_timeframe'}, false)
need_number({'ssid_changer', 'first'}, false)
need_string({'ssid_changer', 'prefix'}, false)
need_one_of({'ssid_changer', 'suffix'}, {'nodename', 'mac', 'none'}, false)
if need_boolean({'ssid_changer','tq_limit_enabled'}, false) then
need_number({'ssid_changer', 'tq_limit_max'}, false)
need_number({'ssid_changer', 'tq_limit_min'}, false)
end
#!/usr/bin/lua
local site = require 'gluon.site_config'
local site = require 'gluon.site'
local uci = require('simple-uci').cursor()
......@@ -13,9 +13,9 @@ elseif not uci:get('ssid-changer', 'settings', 'enabled') then
first = site.ssid_changer.first or '5',
prefix = site.ssid_changer.prefix or 'FF_Offline_',
suffix = site.ssid_changer.suffix or 'nodename',
tq_limit_enabled = site.ssid_changer.tq_limit_enabled or '0',
tq_limit_max = site.ssid_changer.tq_limit_max or '45',
tq_limit_min = site.ssid_changer.tq_limit_min or '35',
tq_limit_enabled = site.ssid_changer.tq_limit_enabled or false,
tq_limit_max = site.ssid_changer.tq_limit_max or 45,
tq_limit_min = site.ssid_changer.tq_limit_min or 35,
})
uci:save('ssid-changer')
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment