diff options
author | Ted Trask <ttrask01@yahoo.com> | 2009-12-25 08:52:50 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2009-12-25 08:52:50 +0000 |
commit | 0be9cc50c885abe6a85bc398d999ab6cda2eb44a (patch) | |
tree | 3125a94294765b3c3772cc44220e9076848f49eb | |
parent | 3fc2855614b96451c99acd40e5083e5c8396dbb9 (diff) | |
download | acf-tinydns-0be9cc50c885abe6a85bc398d999ab6cda2eb44a.tar.bz2 acf-tinydns-0be9cc50c885abe6a85bc398d999ab6cda2eb44a.tar.xz |
Change processname to match prefix - this allows multiple instances without editing.
-rw-r--r-- | tinydns-controller.lua | 5 | ||||
-rw-r--r-- | tinydns-model.lua | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/tinydns-controller.lua b/tinydns-controller.lua index 0461ed9..64a224c 100644 --- a/tinydns-controller.lua +++ b/tinydns-controller.lua @@ -2,6 +2,11 @@ module(..., package.seeall) require("controllerfunctions") require("validator") +mvc = {} +mvc.on_load = function(self, parent) + self.model.set_processname(string.match(self.conf.prefix, "[^/]+")) +end + default_action = "status" function status(self) diff --git a/tinydns-model.lua b/tinydns-model.lua index 5a59c89..a4fd0e5 100644 --- a/tinydns-model.lua +++ b/tinydns-model.lua @@ -49,6 +49,12 @@ local descr = { }, } +function set_processname(p) + processname = p + configfile = "/etc/conf.d/" .. processname + configdir = "/etc/"..processname +end + -- ################################################################################ -- LOCAL FUNCTIONS |