summaryrefslogtreecommitdiffstats
path: root/dhcp-model.lua
diff options
context:
space:
mode:
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