diff options
author | Ted Trask <ttrask01@yahoo.com> | 2008-12-08 16:44:46 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2008-12-08 16:44:46 +0000 |
commit | 1705cd872b0d82473730c8e1cd08c40ea9eacc71 (patch) | |
tree | 59e38c9bebd00e474d273e356bb7a184899b17e2 /ipsectools-model.lua | |
parent | 83284ae6afcea7f9bdc0bbbb0ad85a2b069fa190 (diff) | |
download | acf-ipsec-tools-1705cd872b0d82473730c8e1cd08c40ea9eacc71.tar.bz2 acf-ipsec-tools-1705cd872b0d82473730c8e1cd08c40ea9eacc71.tar.xz |
Modified ipsec-tools to add viewvert.
git-svn-id: svn://svn.alpinelinux.org/acf/ipsec-tools/trunk@1628 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'ipsectools-model.lua')
-rw-r--r-- | ipsectools-model.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ipsectools-model.lua b/ipsectools-model.lua index 5497bd0..433a261 100644 --- a/ipsectools-model.lua +++ b/ipsectools-model.lua @@ -244,3 +244,17 @@ function upload_cert(newcert) return newcert end + +view_cert = function(certname) + local list = list_certs() + local cmdresult = "Invalid cert name" + for i,cert in ipairs(list.value) do + if cert == certname then + local cmd = path .. "openssl x509 -in "..baseurl..certname.." -noout -text" + local f = io.popen(cmd) + cmdresult = f:read("*a") + f:close() + end + end + return cfe({ type="table", value={name=certname, value=cmdresult}, label="Certificate" }) +end |