diff options
author | Ted Trask <ttrask01@yahoo.com> | 2013-10-29 00:38:13 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2013-10-29 00:38:13 +0000 |
commit | 350b1e72e4b21d00770e99471ef3d2ff86ff0d8f (patch) | |
tree | 481a5bb5e84d598a34141a7220a79bfc50c036b6 | |
parent | 08e8df4f69b1a6246b2be6258f56e28fee442021 (diff) | |
download | acf-openvpn-350b1e72e4b21d00770e99471ef3d2ff86ff0d8f.tar.bz2 acf-openvpn-350b1e72e4b21d00770e99471ef3d2ff86ff0d8f.tar.xz |
Use fs.create_directory for the cert directory
-rw-r--r-- | openvpn-model.lua | 5 |
1 files changed, 4 insertions, 1 deletions
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 |