summaryrefslogtreecommitdiffstats
path: root/dhcp-model.lua
diff options
context:
space:
mode:
authorAndreas Brodmann <andreas.brodmann@gmail.com>2008-03-05 13:11:42 +0000
committerAndreas Brodmann <andreas.brodmann@gmail.com>2008-03-05 13:11:42 +0000
commit1af8d04a69cb46bbebfb77a39e14e1c4978a7749 (patch)
tree479d0dec4d72d54a5fafd6e427b9559bafe227ff /dhcp-model.lua
parent0ac0cd4bda4cda5de8a995e2d5715df257929c16 (diff)
downloadacf-dhcp-1af8d04a69cb46bbebfb77a39e14e1c4978a7749.tar.bz2
acf-dhcp-1af8d04a69cb46bbebfb77a39e14e1c4978a7749.tar.xz
cleaned up generation for the first releasev0.3
git-svn-id: svn://svn.alpinelinux.org/acf/dhcp/trunk@819 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'dhcp-model.lua')
-rw-r--r--dhcp-model.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/dhcp-model.lua b/dhcp-model.lua
index 9709e0a..4ea2afd 100644
--- a/dhcp-model.lua
+++ b/dhcp-model.lua
@@ -203,6 +203,22 @@ config_generate = function()
tmpfile:close()
os.rename( tmpfilename, "/etc/dhcp/dhcpd.conf" )
+ -- make sure the master pre/post config files are present
+ local precfg
+ local postcfg
+ precfg = io.open( "/etc/dhcp/dhcpd.preconfig", "r" )
+ postcfg = io.open( "/etc/dhcp/dhcpd.postconfig", "r" )
+
+ if precfg == nil then
+ precfg = io.open( "/etc/dhcp/dhcpd.preconfig", "w+" )
+ end
+ precfg:close()
+
+ if postcfg == nil then
+ postcfg = io.open( "/etc/dhcp/dhcpd.postconfig", "w+" )
+ end
+ postcfg:close()
+
return "Configuration Generation Successful!\n"
end