|
可以用,附件直接用这个:
- cat > "/usr/lib/lua/luci/controller/admin/xqsystem.lua" <<EOF
- module("luci.controller.admin.xqsystem", package.seeall)
- function index()
- local page = node("api")
- page.target = firstchild()
- page.title = ("")
- page.order = 100
- page.index = true
- page = node("api","xqsystem")
- page.target = firstchild()
- page.title = ("")
- page.order = 100
- page.index = true
- entry({"api", "xqsystem", "token"}, call("getToken"), (""), 103, 0x08)
- end
- local LuciHttp = require("luci.http")
- function getToken()
- local result = {}
- result["code"] = 0
- result["token"] = "; nvram set ssh_en=1; nvram set uart_en=1; nvram set boot_wait=on; nvram commit; uci set wireless.@wifi-iface[0].key=\`mkxqimage -I\`; uci commit; sed -i 's/channel=.*/channel="debug"/g' /etc/init.d/dropbear; /etc/init.d/dropbear start;"
- LuciHttp.write_json(result)
- end
- EOF
复制代码 |
|