aboutsummaryrefslogtreecommitdiffstats
path: root/main/aaudit/aaudit-shell
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2014-06-12 07:56:57 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2014-06-12 07:57:18 +0000
commit15f898ca8068419fc02364231bb2981cc54971cb (patch)
treee3ec5995d70831834d467d40615870b44bca7044 /main/aaudit/aaudit-shell
parent94983a506d2e95be0a5864ae7bcc7d7d61dc6cce (diff)
downloadaports-15f898ca8068419fc02364231bb2981cc54971cb.tar.bz2
aports-15f898ca8068419fc02364231bb2981cc54971cb.tar.xz
testing/aaudit: move to main
Diffstat (limited to 'main/aaudit/aaudit-shell')
-rwxr-xr-xmain/aaudit/aaudit-shell15
1 files changed, 15 insertions, 0 deletions
diff --git a/main/aaudit/aaudit-shell b/main/aaudit/aaudit-shell
new file mode 100755
index 0000000000..733341bae9
--- /dev/null
+++ b/main/aaudit/aaudit-shell
@@ -0,0 +1,15 @@
+#!/usr/bin/lua5.2
+
+local json = require 'cjson'
+local aas = require 'aaudit.server'
+
+local req = json.decode(io.read())
+req.remote_ip = (os.getenv("SSH_CLIENT") or ""):match("[^ ]+")
+req.identity = arg[1]
+
+local ok, msg, extra = aas.handle(req, io.stdin)
+
+local object = extra or {}
+object.ok = ok
+object.msg = msg
+print(json.encode(object))