From ddd9693bab4b39a7d15ca24ac014bcc7eff9c600 Mon Sep 17 00:00:00 2001 From: Jan-Tarek Butt <buttjantarek@googlemail.com> Date: Sat, 8 Aug 2015 13:21:09 +0200 Subject: [PATCH] remove if function --- .../lib/gluon/upgrade/530-node-info-interval | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/ffnw-node-info/files/lib/gluon/upgrade/530-node-info-interval b/ffnw-node-info/files/lib/gluon/upgrade/530-node-info-interval index 1878598..63d37e2 100755 --- a/ffnw-node-info/files/lib/gluon/upgrade/530-node-info-interval +++ b/ffnw-node-info/files/lib/gluon/upgrade/530-node-info-interval @@ -3,17 +3,6 @@ local site = require 'gluon.site_config' local uci = require('luci.model.uci').cursor() -local config = 'gluon-node-info' -local interval = uci:get(config, uci:get_first(config, 'location'), 'refresh_interval') - -if site.location then - default_interval = site.location.interval -else - default_interval = interval -end - -if autolocation == 0 then - uci:set(config, uci:get_first(config, 'location'), 'refresh_interval', default_interval) - uci:save(config) - uci:commit(config) -end + uci:set('gluon-node-info', uci:get_first('gluon-node-info', 'location'), 'refresh_interval', site.location.interval) + uci:save('gluon-node-info') + uci:commit('gluon-node-info') -- GitLab