extramodules.lua.svn-base

来自「嵌入式无线路由系统openwrt的web配置工具」· SVN-BASE 代码 · 共 46 行

SVN-BASE
46
字号
#!/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 + =
减小字号Ctrl + -
显示快捷键?