From 350b1e72e4b21d00770e99471ef3d2ff86ff0d8f Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Tue, 29 Oct 2013 00:38:13 +0000 Subject: Use fs.create_directory for the cert directory --- openvpn-model.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'openvpn-model.lua') diff --git a/openvpn-model.lua b/openvpn-model.lua index 66ce958..3c8ce6f 100644 --- a/openvpn-model.lua +++ b/openvpn-model.lua @@ -283,7 +283,7 @@ function mymodule.upload_cert(self, newcert) if success then if not posix.stat(certurl) then - posix.mkdir(certurl) + fs.create_directory(certurl) end -- copy the keys fs.move_file(newcert.value.cert.value.."cert.pem", certurl..newcert.value.name.value.."-cert.pem") @@ -323,6 +323,9 @@ mymodule.get_generate_dh_params = function(self, clientdata) end mymodule.generate_dh_params = function(self, gen) + if not posix.stat(certurl) then + fs.create_directory(certurl) + end gen.descr, gen.errtxt = modelfunctions.run_executable({"openssl", "dhparam", "-out", certurl.."dh1024.pem", "1024"}, true) return gen end -- cgit v1.2.3