From 3f7c448060b852c4fdde1d9698dbde5794d5c980 Mon Sep 17 00:00:00 2001 From: Andreas Brodmann Date: Mon, 19 Nov 2007 15:56:10 +0000 Subject: /acf/dhcp: added global pre/post config generation input for proprietary config code by the user git-svn-id: svn://svn.alpinelinux.org/acf/dhcp/trunk@337 ab2d0c66-481e-0410-8bed-d214d4d58bed --- dhcp-controller.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'dhcp-controller.lua') diff --git a/dhcp-controller.lua b/dhcp-controller.lua index d0a046f..c6d2c83 100644 --- a/dhcp-controller.lua +++ b/dhcp-controller.lua @@ -144,6 +144,28 @@ editnet = function ( self ) return ( cfe({ option = option, value = net, errcode = { msg="", fields={} }}) ) end +editspc = function ( self ) + if not self.clientdata.cmd then + list_redir( self ) + end + + local option = { script = ENV["SCRIPT_NAME"], + prefix = self.conf.prefix, + controller = self.conf.controller, + action = self.conf.action, + extra = "" + } + + if self.clientdata.cmd == "update" then + tmp = self.clientdata + value = self.model.advglobal_update( tmp.preconfig, tmp.postconfig ) + return ( cfe({ option = option, value = value, errcode = { msg="", fields={} }}) ) + end + + value = self.model.advglobal_read() + return ( cfe({ option = option, value = value, errcode = { msg="", fields={} }}) ) +end + createnet = function ( self ) if not self.clientdata.cmd then -- cgit v1.2.3