summaryrefslogtreecommitdiffstats
path: root/openvpn-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'openvpn-model.lua')
-rw-r--r--openvpn-model.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/openvpn-model.lua b/openvpn-model.lua
index 075591f..c324353 100644
--- a/openvpn-model.lua
+++ b/openvpn-model.lua
@@ -226,7 +226,7 @@ end
function create_new_config()
config = {
- name = cfe({ label="File Name" }),
+ name = cfe({ label="File Name", descr="File name should end with \".conf\"" }),
}
return cfe({ type="group", value=config, label="Config" })
@@ -245,6 +245,9 @@ function create_config(config)
elseif posix.stat(path) then
success = false
config.value.name.errtxt = "File already exists"
+ elseif not string.match(path,".*conf") then
+ success = false
+ config.value.name.errtxt = "Filename must end with '.conf'"
end
if success then