From 4141ba46ec1fdc8c2f5305aabd4e6385b33f3a81 Mon Sep 17 00:00:00 2001 From: Alex Oprea Date: Mon, 6 Mar 2017 21:09:33 +0100 Subject: [PATCH] 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. --- iup/files/sbin/iup | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/iup/files/sbin/iup b/iup/files/sbin/iup index fc3b0ca78..e03f8757e 100755 --- a/iup/files/sbin/iup +++ b/iup/files/sbin/iup @@ -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