Merge pull request #5164 from dibdot/openvpn
luci-app-openvpn: create base directory if not available
This commit is contained in:
commit
7da84e543f
1 changed files with 12 additions and 7 deletions
|
@ -19,7 +19,12 @@ function ovpn_upload()
|
|||
local uci = require("luci.model.uci").cursor()
|
||||
local upload = http.formvalue("ovpn_file")
|
||||
local name = http.formvalue("instance_name2")
|
||||
local file = "/etc/openvpn/" ..name.. ".ovpn"
|
||||
local basedir = "/etc/openvpn"
|
||||
local file = basedir.. "/" ..name.. ".ovpn"
|
||||
|
||||
if not fs.stat(basedir) then
|
||||
fs.mkdir(basedir)
|
||||
end
|
||||
|
||||
if name and upload then
|
||||
local fp
|
||||
|
|
Loading…
Reference in a new issue