File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
luci-app-openmptcprouter/luasrc/view/openmptcprouter Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 10
10
local ifaces = sys.net:devices()
11
11
local ifttyu = nixio.fs.glob("/dev/ttyUSB*")
12
12
local ifttyc = nixio.fs.glob("/dev/cdc-wdm*")
13
- local sqm = luci.sys.exec("opkg list-installed | grep -q luci-app-sqm && echo -n '1' || echo -n '0'")
14
- if sqm == "0" then
15
- sqm = luci.sys.exec("apk list | grep installed | grep -q luci-app-sqm && echo -n '1' || echo -n '0'")
13
+ if nixio.fs.stat('/usr/bin/apk', 'type') == 'reg' then
14
+ sqm = luci.sys.exec("apk list 2> /dev/null | grep installed | grep -q luci-app-sqm && echo -n '1' || echo -n '0'")
15
+ else
16
+ sqm = luci.sys.exec("opkg list-installed | grep -q luci-app-sqm && echo -n '1' || echo -n '0'")
16
17
end
17
- local qos = luci.sys.exec("opkg list-installed | grep -q luci-app-qos && echo -n '1' || echo -n '0'")
18
- if qos == "0" then
19
- qos = luci.sys.exec("apk list | grep installed | grep -q luci-app-qos && echo -n '1' || echo -n '0'")
18
+ if nixio.fs.stat('/usr/bin/apk', 'type') == 'reg' then
19
+ qos = luci.sys.exec("apk list 2> /dev/null | grep installed | grep -q luci-app-qos && echo -n '1' || echo -n '0'")
20
+ else
21
+ qos = luci.sys.exec("opkg list-installed | grep -q luci-app-qos && echo -n '1' || echo -n '0'")
20
22
end
21
23
menuentry = uci:get("openmptcprouter","settings","menu") or "openmptcprouter"
22
24
function device_notvirtual(dev)
You can’t perform that action at this time.
0 commit comments