iup: keepuserconfig: improve the functionality refs #11467

the keepuserconfig option is checked in the config
	received though provisioning,
	and not in the config currently configured on the router.
This commit is contained in:
Alex Oprea 2017-03-06 21:09:33 +01:00
parent 2c7dc5c60b
commit 4141ba46ec

View file

@ -68,9 +68,6 @@ reload ()
save_usercfg()
{
local keep=$(uci -q get provisioning.configserver.keepuserconfig )
[ "$keep" == "on" ] || return
rm -f $IUPUSERCFG $IUPUSERCFG_WIFI
touch $IUPUSERCFG $IUPUSERCFG_WIFI
@ -110,8 +107,15 @@ save_usercfg()
apply_usercfg()
{
local keep=$(uci -q get provisioning.configserver.keepuserconfig )
[ "$keep" == "on" ] || return
# decide to save the user changes based on keepuserconfig received through provisioning
local keep
config_load provisioning
config_get_bool keep configserver keepuserconfig "0"
v "apply_usercfg(): keepuserconfig = $keep"
if [ "$keep" != "1" ] ; then
rm -f $IUPUSERCFG $IUPUSERCFG_WIFI
return
fi
local index ifname network
local newindex newifname newnetwork