找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 9723|回复: 49

号外!!! Tomato Phoenix 不死鸟系统成功移植到OpenWRT 更新固件下载地址

[复制链接]
发表于 2017-9-14 18:26 | 显示全部楼层 |阅读模式
本帖最后由 佐须之男 于 2017-9-18 13:36 编辑

   花了大概有两个月时间,完成了Tomato Phoenix不死鸟UI部分的移植,系统采用的是lede,httpd采用的是uhttpd,cgi的语言采用的是lua,并没有基于luci而是从零开始编写的一套自由框架,文章后面有部分cgi的代码实现供网友研究。测试版系统会在近期发布。

固件下载地址:

https://pan.baidu.com/s/1dFq3elb

















很多网友对lua底层实现代码感兴趣,所以我公布几个cgi的代码片段,供大家学习.

config-mac.lua -> 用户获取wan和lan的mac地址


  1. #!/usr/bin/lua

  2. local webio = require("webio")
  3. local header = require("header")
  4. local uci = require("uci")

  5. local x = uci.cursor()

  6. header.send_header(200, nil, "text/javascript", 0)

  7. webio.puts("\nnvram = {\n")

  8. webio.printf("\tmac_lan:'%s'", x:get("network", "wan_dev", "macaddr"))
  9. webio.printf(",\n\tmac_wan:'%s'", x:get("network", "lan_dev", "macaddr"))

  10. webio.puts("};\n");

复制代码





apply-mac.lua -> 用户保存wan,lan的mac地址并生效

  1. #!/usr/bin/lua

  2. local cgi = require("cgi")
  3. local webio = require("webio")
  4. local header = require("header")
  5. local uci = require("uci")

  6. local x = uci.cursor()
  7. local args = cgi.get_uri_args()

  8. header.send_header(200, nil, "text/javascript", 0)
  9. webio.printf("@msg:重启过程中,网络会中断")

  10. local mac_lan = string.match(args["mac_lan"], "([a-fA-F0-9:]+)")

  11. if mac_lan then
  12.         x:set("network", "lan_dev", "macaddr", mac_lan)
  13. end

  14. mac_wan = string.match(args["mac_wan"], "([a-fA-F0-9:]+)")
  15. if mac_wan then
  16.         x:set("network", "wan_dev", "macaddr", mac_wan)
  17. end

  18. x:save("network")
  19. x:commit("network")

  20. os.execute("/etc/init.d/network restart&")
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

评分

参与人数 7恩山币 +17 收起 理由
C*** + 1 我来恩山就是为了撩你!
d2*** + 3 我来恩山就是为了看你!
Hugo*** + 1 我来恩山就是为了看你!
zsh*** + 5 我来恩山就是为了看你!
ws*** + 3 佐大厉害
丰*** + 3 我来恩山就是为了看你!
seg*** + 1 强大的恩山!(以下重复1万次)

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2017-9-14 18:26 | 显示全部楼层
BusyBox v1.25.1 () built-in shell (ash)

     _________
    /        /\      _    ___ ___  ___
   /  LE    /  \    | |  | __|   \| __|
  /    DE  /    \   | |__| _|| |) | _|
/________/  LE  \  |____|___|___/|___|                      lede-project.org
\        \   DE /
  \    LE  \    /  -----------------------------------------------------------
   \  DE    \  /    Reboot (17.01-SNAPSHOT, r3473-a5822db)
    \________\/    -----------------------------------------------------------

=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@LEDE:~#
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-9-14 18:27 | 显示全部楼层
占位瞻仰一下
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-9-14 18:28 | 显示全部楼层
靠前看看,哈哈哈
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-9-14 18:30 | 显示全部楼层
感谢楼主!无私奉献。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-9-14 18:31 来自手机 | 显示全部楼层
佐大威武。。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-9-14 18:49 | 显示全部楼层
都到 LEDE 了,能实现 802.11R 和 Fast Path 吗?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-9-14 18:50 | 显示全部楼层
是不是该改叫 LEDE-Phoenix 了?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-9-14 18:56 | 显示全部楼层
仰望,顺便顶顶顶!!!!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-9-14 19:37 | 显示全部楼层
Hiro 发表于 2017-9-14 18:50
是不是该改叫 LEDE-Phoenix 了?

哈哈 这个可以

我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-9-14 19:39 | 显示全部楼层
如果能把tomato的一些比较实用的功能引入进来还是相当不错的,LEDE/openwrt流控方面实在太弱了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-9-14 19:53 来自手机 | 显示全部楼层
感谢楼主!无私奉献。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-9-14 19:55 | 显示全部楼层
火前留名~~~~`
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-9-14 19:58 | 显示全部楼层
厉害,支持
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-9-14 20:06 | 显示全部楼层
弱弱的问一句,这个有什么优势?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-26 19:33

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表