📄 extramodules.lua
字号:
#!/usr/bin/lua-- Copyright (C) 2008 OpenRB.comrequire('json')-- get list of installed packages and convert to tablef = io.popen('opkg list_installed')installed = {}for line in f:lines() do pos = line:find(' - ') -- skip lines that don't have correct format if (pos ~= nil) then pkg = line:sub(0, pos - 1) installed[ pkg ] = true endendf:close()-- get available busybox modulesf = io.popen('busybox')lines = f:read('*all')f:close()_, pos = lines:find('Currently defined functions:', 1, true)lines = lines:sub(pos + 1)lines = lines:gsub('%s', '') -- cleanupf = truewhile f do pos = lines:find(',', 1, true) if pos then cmd = lines:sub(1, pos - 1) lines = lines:sub(pos + 1) else cmd = lines f = false end installed[ 'busybox_' .. cmd ] = trueend-- return array of installed modulesio.write(json.encode(installed))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -