Commit 222b96a3 authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Ruben Barkow
Browse files

Alway initialize the config section

The /lib/gluon/upgrade/500-ssid-changer script is called when the device is
initialized, reconfigured or upgraded. It will set the configuration to the
site content and prepare everything for the actual gluon_ssid_changer

But it will check whether the ssid-changer.settings.enabled entry exists.
If it does, then it will just ignore the values from the site and skip the
initialization. But the problem here is that the package already provides
this entry in his standard initialization. The section will therefore never
get initialized and thus the package is disabled on all installations.

Instead just copy the content of ssid-changer.settings.enabled when it
exists and otherwise use the data from the site. And the rest of the
configuration must always be copied from the site.
parent b278a1a4
......@@ -6,9 +6,11 @@ local uci = require('simple-uci').cursor()
if site.ssid_changer == nil then
-- print('ssid_changer not defined in site.conf')
elseif not uci:get('ssid-changer', 'settings', 'enabled') then
local site_enabled = site.ssid_changer.enabled() or '1'
uci:section('ssid-changer', 'settings', 'settings', {
enabled = '1',
enabled = uci:get('ssid-changer', 'settings', 'enabled') or site_enabled,
switch_timeframe = site.ssid_changer.switch_timeframe() or '30',
first = site.ssid_changer.first() or '5',
prefix = site.ssid_changer.prefix() or 'FF_Offline_',
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