policy: Switch policy settings to JSON
- Create policy-settings.conf and move all the policy settings to it. - Change all the policy scripts to fetch the settigs from WpSettings API. - Remove all the references to config/lua.
This commit is contained in:

committed by
Julian Bouzas

parent
067b1954e3
commit
8a0c4fde4c
@@ -5,12 +5,8 @@
|
||||
--
|
||||
-- SPDX-License-Identifier: MIT
|
||||
|
||||
-- Receive script arguments from config.lua
|
||||
local config = ... or {}
|
||||
|
||||
-- ensure config.move and config.follow are not nil
|
||||
config.move = config.move or false
|
||||
config.follow = config.follow or false
|
||||
local move = Settings.get_boolean ("default-policy-move") or false
|
||||
local follow = Settings.get_boolean ("default-policy-follow") or false
|
||||
|
||||
local self = {}
|
||||
self.scanning = false
|
||||
@@ -210,8 +206,8 @@ links_om = ObjectManager {
|
||||
}
|
||||
}
|
||||
|
||||
-- listen for default node changes if config.follow is enabled
|
||||
if config.follow then
|
||||
-- listen for default node changes if "follow" setting is enabled
|
||||
if follow then
|
||||
default_nodes:connect("changed", function (p)
|
||||
scheduleRescan ()
|
||||
end)
|
||||
|
Reference in New Issue
Block a user