mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 07:55:13 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"admin/network/einat": {
|
||||
"title": "einat-ebpf",
|
||||
"order": 60,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "einat"
|
||||
},
|
||||
"depends": {
|
||||
"acl": [ "luci-app-einat" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"luci-app-einat": {
|
||||
"description": "Grant access to LuCI app einat",
|
||||
"read": {
|
||||
"file": {
|
||||
"/etc/init.d/einat reload": [ "exec" ]
|
||||
},
|
||||
"ubus": {
|
||||
"service": [ "list" ],
|
||||
"luci.einat": [ "*" ]
|
||||
},
|
||||
"uci": ["einat"]
|
||||
},
|
||||
"write": {
|
||||
"ubus": {
|
||||
"rc": [ "init" ]
|
||||
},
|
||||
"uci": ["einat"]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/ucode
|
||||
|
||||
'use strict';
|
||||
|
||||
import { access, popen } from 'fs';
|
||||
|
||||
const methods = {
|
||||
get_features: {
|
||||
call: function() {
|
||||
let features = {
|
||||
version: null,
|
||||
features: [],
|
||||
build_features: []
|
||||
};
|
||||
|
||||
const fd = popen('/usr/bin/einat -v');
|
||||
if (fd) {
|
||||
for (let line = fd.read('line'); length(line); line = fd.read('line')) {
|
||||
let ver = match(trim(line), /version: (\S+)/);
|
||||
if (ver)
|
||||
features.version = ver[1];
|
||||
let feats = match(trim(line), /features: (\S+)/);
|
||||
if (feats)
|
||||
features.features = split(feats[1], ',');
|
||||
let build_feats = match(trim(line), /build_features: (\S+)/);
|
||||
if (build_feats)
|
||||
features.build_features = split(build_feats[1], ',');
|
||||
}
|
||||
|
||||
fd.close();
|
||||
}
|
||||
|
||||
return features;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return { 'luci.einat': methods };
|
||||
Reference in new issue
Block a user