diff options
Diffstat (limited to 'applications/luci-app-softether/root')
3 files changed, 56 insertions, 0 deletions
diff --git a/applications/luci-app-softether/root/usr/libexec/vpncmd-call b/applications/luci-app-softether/root/usr/libexec/vpncmd-call new file mode 100755 index 0000000000..3d671dce4c --- /dev/null +++ b/applications/luci-app-softether/root/usr/libexec/vpncmd-call @@ -0,0 +1,31 @@ +#!/bin/sh + +action=$1 +shift + +case "$action" in + nic-list) + /usr/bin/vpncmd localhost /client /csv /cmd:niclist | tail -n +4 2> /dev/null + ;; + nic-create) + /usr/bin/vpncmd localhost /client /cmd:niccreate $1 > /dev/null && echo "OK" || echo "NOK" + ;; + nic-delete) + /usr/bin/vpncmd localhost /client /csv /cmd:nicdelete $1 > /dev/null && echo "OK" || echo "NOK" + ;; + account-list) + /usr/bin/vpncmd localhost /client /csv /cmd:accountlist | tail -n +4 2> /dev/null + ;; + account-status-get) + /usr/bin/vpncmd localhost /client /csv /cmd:accountstatusget $1 | tail -n +4 2> /dev/null + ;; + *) + echo "Usage:" >&2 + echo " $0 {nic-list}" >&2 + echo " $0 {nic-create} {name}" >&2 + echo " $0 {nic-delete} {name}" >&2 + echo " $0 {account-list}" >&2 + echo " $0 {account-status-get {accountname}" >&2 + exit 1 + ;; +esac diff --git a/applications/luci-app-softether/root/usr/share/luci/menu.d/luci-app-softether.json b/applications/luci-app-softether/root/usr/share/luci/menu.d/luci-app-softether.json new file mode 100644 index 0000000000..c0ed09c20f --- /dev/null +++ b/applications/luci-app-softether/root/usr/share/luci/menu.d/luci-app-softether.json @@ -0,0 +1,13 @@ +{ + "admin/status/softether": { + "title": "SoftEther Status", + "order": 95, + "action": { + "type": "view", + "path": "softether-status" + }, + "depends": { + "acl": [ "luci-app-softether" ] + } + } +} diff --git a/applications/luci-app-softether/root/usr/share/rpcd/acl.d/luci-app-softether.json b/applications/luci-app-softether/root/usr/share/rpcd/acl.d/luci-app-softether.json new file mode 100644 index 0000000000..900e4bed78 --- /dev/null +++ b/applications/luci-app-softether/root/usr/share/rpcd/acl.d/luci-app-softether.json @@ -0,0 +1,12 @@ +{ + "luci-app-softether": { + "description": "Grant access to softether management", + "read": { + "cgi-io": [ "exec" ], + "file": { + "/usr/libexec/vpncmd-call account-list": [ "exec" ], + "/usr/libexec/vpncmd-call account-status-get *": [ "exec" ] + } + } + } +} |