summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--modules/luci-base/root/usr/share/rpcd/ucode/luci31
1 files changed, 18 insertions, 13 deletions
diff --git a/modules/luci-base/root/usr/share/rpcd/ucode/luci b/modules/luci-base/root/usr/share/rpcd/ucode/luci
index cb00ff86d4..e237979352 100644
--- a/modules/luci-base/root/usr/share/rpcd/ucode/luci
+++ b/modules/luci-base/root/usr/share/rpcd/ucode/luci
@@ -159,20 +159,25 @@ const methods = {
call: function() {
const uci = cursor();
let helpers = [];
-
- uci.load('/usr/share/firewall4/helpers');
- uci.load('/usr/share/fw3/helpers.conf');
-
- uci.foreach('helpers', 'helper', (s) => {
- push(helpers, {
- name: s.name,
- description: s.description,
- module: s.module,
- family: s.family,
- proto: s.proto,
- port: s.port
+ let package;
+
+ if (uci.load('/usr/share/firewall4/helpers'))
+ package = 'helpers';
+ else if (uci.load('/usr/share/fw3/helpers.conf'))
+ package = 'helpers.conf';
+
+ if (package) {
+ uci.foreach(package, 'helper', (s) => {
+ push(helpers, {
+ name: s.name,
+ description: s.description,
+ module: s.module,
+ family: s.family,
+ proto: s.proto,
+ port: s.port
+ });
});
- });
+ }
return { result: helpers };
}