diff options
author | Ted Trask <ttrask01@yahoo.com> | 2015-04-27 11:06:39 -0400 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2015-04-27 11:06:39 -0400 |
commit | f8721f3b56e268563e6e4b10a4bdd71b580e6438 (patch) | |
tree | 73b8dc764440efb2ad1e0fab79a76208df4aae35 | |
parent | 125e8390f7a61dd8f79541b8623e862d4eb71215 (diff) | |
download | acf-openvpn-f8721f3b56e268563e6e4b10a4bdd71b580e6438.tar.bz2 acf-openvpn-f8721f3b56e268563e6e4b10a4bdd71b580e6438.tar.xz |
Use /var/log/messages if log / logappend not specified in config
-rw-r--r-- | openvpn-logfile-html.lsp | 6 | ||||
-rw-r--r-- | openvpn-model.lua | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/openvpn-logfile-html.lsp b/openvpn-logfile-html.lsp index 16c583a..edb3867 100644 --- a/openvpn-logfile-html.lsp +++ b/openvpn-logfile-html.lsp @@ -2,5 +2,9 @@ %> <% if viewlibrary and viewlibrary.dispatch_component then - viewlibrary.dispatch_component("alpine-baselayout/logfiles/view", {filename=data.value}) + local clientdata = {} + for n,v in pairs(data.value) do + clientdata[n] = v.value + end + viewlibrary.dispatch_component("alpine-baselayout/logfiles/view", clientdata) end %> diff --git a/openvpn-model.lua b/openvpn-model.lua index b85c4d9..adaee27 100644 --- a/openvpn-model.lua +++ b/openvpn-model.lua @@ -188,7 +188,12 @@ end function mymodule.get_logfile(f) local config = config_content(configfile) - return cfe({ value=config.log or "", label="Log file" }) + local value = {} + value.filename = cfe({value=config.log or "/var/log/messages", label="File name"}) + if not config.log then + value.grep = cfe({ value="openvpn", label="Grep" }) + end + return cfe({ value=value, label="Log file" }) end function mymodule.get_filecontent() |