From 90f616e2aa5909a6d4bda18ba48376e09dea2ed0 Mon Sep 17 00:00:00 2001 From: Twinzo1 <44726207+Twinzo1@users.noreply.github.com> Date: Sat, 1 Dec 2018 14:58:01 +0800 Subject: [PATCH 01/11] Add files via upload --- "openwrt/p\347\211\210/bin/transdrcom" | 12 + "openwrt/p\347\211\210/etc/config/drcom" | 7 + "openwrt/p\347\211\210/etc/init.d/drcom" | 39 ++ "openwrt/p\347\211\210/etc/rc.d/S90drcom" | 39 ++ "openwrt/p\347\211\210/readme.txt" | 35 ++ "openwrt/p\347\211\210/usr/bin/drcom" | 450 ++++++++++++++++++ .../usr/lib/lua/luci/controller/drcom.lua" | 19 + .../usr/lib/lua/luci/model/cbi/drcom.lua" | 60 +++ 8 files changed, 661 insertions(+) create mode 100644 "openwrt/p\347\211\210/bin/transdrcom" create mode 100644 "openwrt/p\347\211\210/etc/config/drcom" create mode 100644 "openwrt/p\347\211\210/etc/init.d/drcom" create mode 100644 "openwrt/p\347\211\210/etc/rc.d/S90drcom" create mode 100644 "openwrt/p\347\211\210/readme.txt" create mode 100644 "openwrt/p\347\211\210/usr/bin/drcom" create mode 100644 "openwrt/p\347\211\210/usr/lib/lua/luci/controller/drcom.lua" create mode 100644 "openwrt/p\347\211\210/usr/lib/lua/luci/model/cbi/drcom.lua" diff --git "a/openwrt/p\347\211\210/bin/transdrcom" "b/openwrt/p\347\211\210/bin/transdrcom" new file mode 100644 index 0000000..f838cbf --- /dev/null +++ "b/openwrt/p\347\211\210/bin/transdrcom" @@ -0,0 +1,12 @@ +#!/bin/sh +# Copyright (c) 2014 OpenWrt +# Copyright (c) 2016 Sui +curdir=/etc/config/drcom.conf +touch $curdir +tmp_server="server = '$(uci get drcom.@drcom[0].server)'" +tmp_pppoe_flag="pppoe_flag = '$(uci get drcom.@drcom[0].pppoe_flag)'" +tmp_keep_alive2_flag="keep_alive2_flag = '$(uci get drcom.@drcom[0].keep_alive2_flag)'" +echo $tmp_server >> $curdir +echo "$tmp_pppoe_flag" >> "$curdir" +echo "$tmp_keep_alive2_flag" >> "$curdir" + diff --git "a/openwrt/p\347\211\210/etc/config/drcom" "b/openwrt/p\347\211\210/etc/config/drcom" new file mode 100644 index 0000000..a63b04e --- /dev/null +++ "b/openwrt/p\347\211\210/etc/config/drcom" @@ -0,0 +1,7 @@ + +config drcom + option keep_alive2_flag '\xdc' + option server '10.0.3.2' + option pppoe_flag '\x2f' + option enable '1' + diff --git "a/openwrt/p\347\211\210/etc/init.d/drcom" "b/openwrt/p\347\211\210/etc/init.d/drcom" new file mode 100644 index 0000000..e1b9c9c --- /dev/null +++ "b/openwrt/p\347\211\210/etc/init.d/drcom" @@ -0,0 +1,39 @@ +#!/bin/sh /etc/rc.common +# Copyright (c) 2016, Sui +START=90 + +drcom_up() +{ + local enable + config_get_bool enable $1 enable + if [ $enable ]; then + transdrcom + drcom & + sleep 5 + echo "Dr.COM Client is started" + else + stop + fi +} + +start() +{ + sleep 10 + rm -rf /etc/config/drcom.conf + config_load drcom + config_foreach drcom_up drcom +} + +stop() +{ + kill -9 `ps | grep drcom | grep python | awk '{print $1}'` + echo "Dr.COM Client is stopped" +} + +restart() +{ + stop + rm -rf /etc/config/drcom.conf + config_load drcom + config_foreach drcom_up drcom +} diff --git "a/openwrt/p\347\211\210/etc/rc.d/S90drcom" "b/openwrt/p\347\211\210/etc/rc.d/S90drcom" new file mode 100644 index 0000000..e1b9c9c --- /dev/null +++ "b/openwrt/p\347\211\210/etc/rc.d/S90drcom" @@ -0,0 +1,39 @@ +#!/bin/sh /etc/rc.common +# Copyright (c) 2016, Sui +START=90 + +drcom_up() +{ + local enable + config_get_bool enable $1 enable + if [ $enable ]; then + transdrcom + drcom & + sleep 5 + echo "Dr.COM Client is started" + else + stop + fi +} + +start() +{ + sleep 10 + rm -rf /etc/config/drcom.conf + config_load drcom + config_foreach drcom_up drcom +} + +stop() +{ + kill -9 `ps | grep drcom | grep python | awk '{print $1}'` + echo "Dr.COM Client is stopped" +} + +restart() +{ + stop + rm -rf /etc/config/drcom.conf + config_load drcom + config_foreach drcom_up drcom +} diff --git "a/openwrt/p\347\211\210/readme.txt" "b/openwrt/p\347\211\210/readme.txt" new file mode 100644 index 0000000..65f25f5 --- /dev/null +++ "b/openwrt/p\347\211\210/readme.txt" @@ -0,0 +1,35 @@ +p版python使用教程; + +1、 + 将三个文件夹拉入root文件夹中,使用 'scp -r 文件夹 /' 命令将三个文件夹覆盖进去。 +2、 + 修改文件权限为777,右键属性修改。 +3、 + 拨号:在putty直接粘贴这几条命令: + #!/bin/sh + cp /lib/netifd/proto/ppp.sh /lib/netifd/proto/ppp.sh_bak + sed -i '/proto_run_command/i username=`echo -e "$username"`' /lib/netifd/proto/ppp.sh + sed -i '/proto_run_command/i password=`echo -e "$password"`' /lib/netifd/proto/ppp.sh + 拨号账号要加上\r\n +4、安装python: +闪存剩余大小低于7.5M,安以下方式安装 + + opkg update + + opkg install python-light -d ram + + export PATH=$PATH:/tmp/usr/bin/ + + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/usr/lib/ + + + 将最后两行添加到/etc/profile中,重启路由器,再一次执行 + opkg update + opkg install python-lightd + 配置好之后如果drcom不能运行再重新执行 + opkg update + opkg install python-lightd +5、 + 心跳包:wireshark抓包,去https://drcoms.github.io/drcom-generic/生成心跳包,然后在luci界面填写即可。 +6、 + /etc/rc.d/S90drocm是一个链接,可能需要重新建立,右键新建链接,链接到../init.d/drcom即可。 \ No newline at end of file diff --git "a/openwrt/p\347\211\210/usr/bin/drcom" "b/openwrt/p\347\211\210/usr/bin/drcom" new file mode 100644 index 0000000..bec58c5 --- /dev/null +++ "b/openwrt/p\347\211\210/usr/bin/drcom" @@ -0,0 +1,450 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import socket +import struct +import time +import sys +import random +import os +import hashlib + +from array import array +from string import join +from struct import pack, unpack + +# CONFIG +server = '172.30.1.80' +pppoe_flag = '\x2a' +keep_alive2_flag = '\xdc' +# CONFIG_END + +host_ip = server +IS_TEST = False +CONF = "/etc/config/drcom.conf" +DEBUG = False #log saves to file +if IS_TEST: + CONF = '' + DEBUG = True + LOG_PATH = 'drcom_client.log' + +# MD4 hash fallback # +_DECODE = lambda x, e: list(array('B', x.decode(e))) +_ENCODE = lambda x, e: join([chr(i) for i in x], '').encode(e) +HEX_TO_BYTES = lambda x: _DECODE(x, 'hex') +TXT_TO_BYTES = lambda x: HEX_TO_BYTES(x.encode('hex')) +BYTES_TO_HEX = lambda x: _ENCODE(x, 'hex') +BYTES_TO_TXT = lambda x: BYTES_TO_HEX(x).decode('hex') + +def _pad(msg): + n = len(msg) + bit_len = n * 8 + index = (bit_len >> 3) & 0x3fL + pad_len = 120 - index + if index < 56: + pad_len = 56 - index + padding = '\x80' + '\x00'*63 + padded_msg = msg + padding[:pad_len] + pack('> (32 - b))) & 0xffffffff + +def _f(x, y, z): return x & y | ~x & z +def _g(x, y, z): return x & y | x & z | y & z +def _h(x, y, z): return x ^ y ^ z + +def _f1(a, b, c, d, k, s, X): return _left_rotate(a + _f(b, c, d) + X[k], s) +def _f2(a, b, c, d, k, s, X): return _left_rotate(a + _g(b, c, d) + X[k] + 0x5a827999, s) +def _f3(a, b, c, d, k, s, X): return _left_rotate(a + _h(b, c, d) + X[k] + 0x6ed9eba1, s) + +class MD4: + def __init__(self, message_string): + self.A = 0x67452301 + self.B = 0xefcdab89 + self.C = 0x98badcfe + self.D = 0x10325476 + msg_bytes = TXT_TO_BYTES(_pad(message_string)) + for i in range(0, len(msg_bytes), 64): + self._compress(msg_bytes[i:i+64]) + + def _compress(self, block): + a, b, c, d = self.A, self.B, self.C, self.D + x = [] + for i in range(0, 64, 4): + x.append(unpack(' +# Edit by Sui +]]-- + +module("luci.controller.drcom", package.seeall) + +function index() + + if not nixio.fs.access("/etc/config/drcom") then + return + end + + local page + + page = entry({"admin", "services", "Dr.COM"}, cbi("drcom"), _("Dr.COM"), 45) + page.i18n = "DrCOM" + page.dependent = true +end diff --git "a/openwrt/p\347\211\210/usr/lib/lua/luci/model/cbi/drcom.lua" "b/openwrt/p\347\211\210/usr/lib/lua/luci/model/cbi/drcom.lua" new file mode 100644 index 0000000..386bfac --- /dev/null +++ "b/openwrt/p\347\211\210/usr/lib/lua/luci/model/cbi/drcom.lua" @@ -0,0 +1,60 @@ +--[[ +# Copyright (c) 2014-2016, latyas +# Edit by Sui +]]-- +require("luci.sys") +local fs = require "nixio.fs" +local nixio = require "nixio" + +local drcom_running =(luci.sys.call("ps | grep drcom |egrep -v grep > /dev/null") == 0) +local client_status + +if drcom_running then + client_status = "瀹㈡埛绔繍琛屼腑" +else + client_status = "瀹㈡埛绔湭杩愯" +end + +m = Map("drcom", translate("Dr.COM"), translate(client_status)) + +s = m:section(TypedSection, "drcom", translate("瀹㈡埛绔厤缃"), +translate("LuCI鐗堟湰鐨凞r.COM閰嶇疆.").. +"
" +..[[
]] +..[[]] +..translate("娆㈣繋鍔犲叆鏈」鐩殑璁ㄨ缁(娉ㄦ剰锛氶渶瑕丗Q)銆") +..[[]] +..[[
]] +..[[
]] +..[[]] +..translate("瀹樻柟浜ゆ祦QQ缇:318495368锛屾杩庡姞鍏ャ") +..[[]] +..[[
]] +..[[
]] +..[[]] +..translate("鏈」鐩湪GitHub鐨勯」鐩湴鍧銆") +..[[]] +..[[
]] +..[[
]] +..[[]] +..translate("鏌ョ湅鏈〉闈㈢殑鐩稿叧鑷畾涔変慨鏀瑰拰閰嶇疆璇存槑銆") +..[[]] +..[[
]] +) +s.anonymous = true + +enable = s:option(Flag, "enable", translate("寮鍚疍r.com")) + +remote_server = s:option(Value, "server", translate("璁よ瘉鏈嶅姟鍣ㄥ湴鍧")) +remote_server.datatype = "ip4addr" +remote_server.defaule = "192.168.1.1" + +pppoe_flag = s:option(Value, "pppoe_flag", translate("pppoe_flag")) +keep_alive2_flag = s:option(Value, "keep_alive2_flag", translate("keep_alive2_flag")) + +local apply = luci.http.formvalue("cbi.apply") +if apply then + io.popen("/etc/init.d/drcom restart") +end + +return m From c5a2510ee38a9043a6e2ff71672ce5a22a91d4f0 Mon Sep 17 00:00:00 2001 From: Twinzo1 <44726207+Twinzo1@users.noreply.github.com> Date: Sat, 1 Dec 2018 14:58:56 +0800 Subject: [PATCH 02/11] Update readme.txt --- "openwrt/p\347\211\210/readme.txt" | 44 +++++++++++++++--------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git "a/openwrt/p\347\211\210/readme.txt" "b/openwrt/p\347\211\210/readme.txt" index 65f25f5..ee0cbdf 100644 --- "a/openwrt/p\347\211\210/readme.txt" +++ "b/openwrt/p\347\211\210/readme.txt" @@ -1,35 +1,35 @@ -p版python使用教程; +p鐗坧ython浣跨敤鏁欑▼锛 -1、 - 将三个文件夹拉入root文件夹中,使用 'scp -r 文件夹 /' 命令将三个文件夹覆盖进去。 -2、 - 修改文件权限为777,右键属性修改。 -3、 - 拨号:在putty直接粘贴这几条命令: +1銆 + 灏嗕笁涓枃浠跺す鎷夊叆root鏂囦欢澶逛腑锛屼娇鐢 'scp -r 鏂囦欢澶 /' 鍛戒护灏嗕笁涓枃浠跺す瑕嗙洊杩涘幓銆 +2銆 + 淇敼鏂囦欢鏉冮檺涓777锛屽彸閿睘鎬т慨鏀广 +3銆 + 鎷ㄥ彿锛氬湪putty鐩存帴绮樿创杩欏嚑鏉″懡浠わ細 #!/bin/sh cp /lib/netifd/proto/ppp.sh /lib/netifd/proto/ppp.sh_bak sed -i '/proto_run_command/i username=`echo -e "$username"`' /lib/netifd/proto/ppp.sh sed -i '/proto_run_command/i password=`echo -e "$password"`' /lib/netifd/proto/ppp.sh - 拨号账号要加上\r\n -4、安装python: -闪存剩余大小低于7.5M,安以下方式安装 - + 鎷ㄥ彿璐﹀彿瑕佸姞涓奬r\n +4銆佸畨瑁卲ython锛 +闂瓨鍓╀綑澶у皬浣庝簬7.5M锛屽畨浠ヤ笅鏂瑰紡瀹夎 + opkg update - - opkg install python-light -d ram + + opkg install python-light -d ram export PATH=$PATH:/tmp/usr/bin/ - + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/usr/lib/ - - - 将最后两行添加到/etc/profile中,重启路由器,再一次执行 + + + 灏嗘渶鍚庝袱琛屾坊鍔犲埌/etc/profile涓紝閲嶅惎璺敱鍣紝鍐嶄竴娆℃墽琛 opkg update opkg install python-lightd - 配置好之后如果drcom不能运行再重新执行 + 閰嶇疆濂戒箣鍚庡鏋渄rcom涓嶈兘杩愯鍐嶉噸鏂版墽琛 opkg update opkg install python-lightd -5、 - 心跳包:wireshark抓包,去https://drcoms.github.io/drcom-generic/生成心跳包,然后在luci界面填写即可。 -6、 - /etc/rc.d/S90drocm是一个链接,可能需要重新建立,右键新建链接,链接到../init.d/drcom即可。 \ No newline at end of file +5銆 + 蹇冭烦鍖咃細wireshark鎶撳寘锛屽幓https://drcoms.github.io/drcom-generic/ 鐢熸垚蹇冭烦鍖咃紝鐒跺悗鍦╨uci鐣岄潰濉啓鍗冲彲銆 +6銆 + /etc/rc.d/S90drocm鏄竴涓摼鎺ワ紝鍙兘闇瑕侀噸鏂板缓绔嬶紝鍙抽敭鏂板缓閾炬帴锛岄摼鎺ュ埌../init.d/drcom鍗冲彲銆 From 8bc8bf5f62f11976f85539522564578146679b2a Mon Sep 17 00:00:00 2001 From: Twinzo1 <44726207+Twinzo1@users.noreply.github.com> Date: Sat, 1 Dec 2018 15:11:04 +0800 Subject: [PATCH 03/11] Delete readme.txt --- "openwrt/p\347\211\210/readme.txt" | 35 ------------------------------ 1 file changed, 35 deletions(-) delete mode 100644 "openwrt/p\347\211\210/readme.txt" diff --git "a/openwrt/p\347\211\210/readme.txt" "b/openwrt/p\347\211\210/readme.txt" deleted file mode 100644 index ee0cbdf..0000000 --- "a/openwrt/p\347\211\210/readme.txt" +++ /dev/null @@ -1,35 +0,0 @@ -p鐗坧ython浣跨敤鏁欑▼锛 - -1銆 - 灏嗕笁涓枃浠跺す鎷夊叆root鏂囦欢澶逛腑锛屼娇鐢 'scp -r 鏂囦欢澶 /' 鍛戒护灏嗕笁涓枃浠跺す瑕嗙洊杩涘幓銆 -2銆 - 淇敼鏂囦欢鏉冮檺涓777锛屽彸閿睘鎬т慨鏀广 -3銆 - 鎷ㄥ彿锛氬湪putty鐩存帴绮樿创杩欏嚑鏉″懡浠わ細 - #!/bin/sh - cp /lib/netifd/proto/ppp.sh /lib/netifd/proto/ppp.sh_bak - sed -i '/proto_run_command/i username=`echo -e "$username"`' /lib/netifd/proto/ppp.sh - sed -i '/proto_run_command/i password=`echo -e "$password"`' /lib/netifd/proto/ppp.sh - 鎷ㄥ彿璐﹀彿瑕佸姞涓奬r\n -4銆佸畨瑁卲ython锛 -闂瓨鍓╀綑澶у皬浣庝簬7.5M锛屽畨浠ヤ笅鏂瑰紡瀹夎 - - opkg update - - opkg install python-light -d ram - - export PATH=$PATH:/tmp/usr/bin/ - - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/usr/lib/ - - - 灏嗘渶鍚庝袱琛屾坊鍔犲埌/etc/profile涓紝閲嶅惎璺敱鍣紝鍐嶄竴娆℃墽琛 - opkg update - opkg install python-lightd - 閰嶇疆濂戒箣鍚庡鏋渄rcom涓嶈兘杩愯鍐嶉噸鏂版墽琛 - opkg update - opkg install python-lightd -5銆 - 蹇冭烦鍖咃細wireshark鎶撳寘锛屽幓https://drcoms.github.io/drcom-generic/ 鐢熸垚蹇冭烦鍖咃紝鐒跺悗鍦╨uci鐣岄潰濉啓鍗冲彲銆 -6銆 - /etc/rc.d/S90drocm鏄竴涓摼鎺ワ紝鍙兘闇瑕侀噸鏂板缓绔嬶紝鍙抽敭鏂板缓閾炬帴锛岄摼鎺ュ埌../init.d/drcom鍗冲彲銆 From 589bda795e03114d5935092ee52e86b87d253021 Mon Sep 17 00:00:00 2001 From: Twinzo1 <44726207+Twinzo1@users.noreply.github.com> Date: Sat, 1 Dec 2018 15:11:53 +0800 Subject: [PATCH 04/11] Create README.md --- "openwrt/p\347\211\210/README.md" | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 "openwrt/p\347\211\210/README.md" diff --git "a/openwrt/p\347\211\210/README.md" "b/openwrt/p\347\211\210/README.md" new file mode 100644 index 0000000..faac2d3 --- /dev/null +++ "b/openwrt/p\347\211\210/README.md" @@ -0,0 +1,35 @@ +p鐗坧ython浣跨敤鏁欑▼锛 + +1銆 + 灏嗕笁涓枃浠跺す鎷夊叆root鏂囦欢澶逛腑锛屼娇鐢 'scp -r 鏂囦欢澶 /' 鍛戒护灏嗕笁涓枃浠跺す瑕嗙洊杩涘幓銆 +2銆 + 淇敼鏂囦欢鏉冮檺涓777锛屽彸閿睘鎬т慨鏀广 +3銆 + 鎷ㄥ彿锛氬湪putty鐩存帴绮樿创杩欏嚑鏉″懡浠わ細 + #!/bin/sh + cp /lib/netifd/proto/ppp.sh /lib/netifd/proto/ppp.sh_bak + sed -i '/proto_run_command/i username=`echo -e "$username"`' /lib/netifd/proto/ppp.sh + sed -i '/proto_run_command/i password=`echo -e "$password"`' /lib/netifd/proto/ppp.sh + 鎷ㄥ彿璐﹀彿瑕佸姞涓奬r\n +4銆佸畨瑁卲ython锛 +闂瓨鍓╀綑澶у皬浣庝簬7.5M锛屽畨浠ヤ笅鏂瑰紡瀹夎 + + opkg update + + opkg install python-light -d ram + + export PATH=$PATH:/tmp/usr/bin/ + + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/usr/lib/ + + + 灏嗘渶鍚庝袱琛屾坊鍔犲埌/etc/profile涓紝閲嶅惎璺敱鍣紝鍐嶄竴娆℃墽琛 + opkg update + opkg install python-lightd + 閰嶇疆濂戒箣鍚庡鏋渄rcom涓嶈兘杩愯鍐嶉噸鏂版墽琛 + opkg update + opkg install python-lightd +5銆 + 蹇冭烦鍖咃細wireshark鎶撳寘锛屽幓https://drcoms.github.io/drcom-generic/ 鐢熸垚蹇冭烦鍖咃紝鐒跺悗鍦╨uci鐣岄潰濉啓鍗冲彲銆 +6銆 + /etc/rc.d/S90drocm鏄竴涓摼鎺ワ紝鍙兘闇瑕侀噸鏂板缓绔嬶紝鍙抽敭鏂板缓閾炬帴锛岄摼鎺ュ埌../init.d/drcom鍗冲彲銆 From a5acc247d0ef8e26d313b2215b7699b028e003e9 Mon Sep 17 00:00:00 2001 From: Twinzo1 <44726207+Twinzo1@users.noreply.github.com> Date: Sat, 1 Dec 2018 15:13:15 +0800 Subject: [PATCH 05/11] Update README.md --- "openwrt/p\347\211\210/README.md" | 3 +++ 1 file changed, 3 insertions(+) diff --git "a/openwrt/p\347\211\210/README.md" "b/openwrt/p\347\211\210/README.md" index faac2d3..30f4b6f 100644 --- "a/openwrt/p\347\211\210/README.md" +++ "b/openwrt/p\347\211\210/README.md" @@ -2,8 +2,10 @@ p鐗坧ython浣跨敤鏁欑▼锛 1銆 灏嗕笁涓枃浠跺す鎷夊叆root鏂囦欢澶逛腑锛屼娇鐢 'scp -r 鏂囦欢澶 /' 鍛戒护灏嗕笁涓枃浠跺す瑕嗙洊杩涘幓銆 + 2銆 淇敼鏂囦欢鏉冮檺涓777锛屽彸閿睘鎬т慨鏀广 + 3銆 鎷ㄥ彿锛氬湪putty鐩存帴绮樿创杩欏嚑鏉″懡浠わ細 #!/bin/sh @@ -11,6 +13,7 @@ p鐗坧ython浣跨敤鏁欑▼锛 sed -i '/proto_run_command/i username=`echo -e "$username"`' /lib/netifd/proto/ppp.sh sed -i '/proto_run_command/i password=`echo -e "$password"`' /lib/netifd/proto/ppp.sh 鎷ㄥ彿璐﹀彿瑕佸姞涓奬r\n + 4銆佸畨瑁卲ython锛 闂瓨鍓╀綑澶у皬浣庝簬7.5M锛屽畨浠ヤ笅鏂瑰紡瀹夎 From 01d3f8b01d7e1d06c130bd752b5ccfeb719a5432 Mon Sep 17 00:00:00 2001 From: Twinzo1 <44726207+Twinzo1@users.noreply.github.com> Date: Sat, 1 Dec 2018 15:13:52 +0800 Subject: [PATCH 06/11] Update README.md --- "openwrt/p\347\211\210/README.md" | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git "a/openwrt/p\347\211\210/README.md" "b/openwrt/p\347\211\210/README.md" index 30f4b6f..6ca78fd 100644 --- "a/openwrt/p\347\211\210/README.md" +++ "b/openwrt/p\347\211\210/README.md" @@ -8,10 +8,15 @@ p鐗坧ython浣跨敤鏁欑▼锛 3銆 鎷ㄥ彿锛氬湪putty鐩存帴绮樿创杩欏嚑鏉″懡浠わ細 + #!/bin/sh + cp /lib/netifd/proto/ppp.sh /lib/netifd/proto/ppp.sh_bak + sed -i '/proto_run_command/i username=`echo -e "$username"`' /lib/netifd/proto/ppp.sh + sed -i '/proto_run_command/i password=`echo -e "$password"`' /lib/netifd/proto/ppp.sh + 鎷ㄥ彿璐﹀彿瑕佸姞涓奬r\n 4銆佸畨瑁卲ython锛 @@ -27,12 +32,18 @@ p鐗坧ython浣跨敤鏁欑▼锛 灏嗘渶鍚庝袱琛屾坊鍔犲埌/etc/profile涓紝閲嶅惎璺敱鍣紝鍐嶄竴娆℃墽琛 + opkg update + opkg install python-lightd + 閰嶇疆濂戒箣鍚庡鏋渄rcom涓嶈兘杩愯鍐嶉噸鏂版墽琛 opkg update + opkg install python-lightd + 5銆 蹇冭烦鍖咃細wireshark鎶撳寘锛屽幓https://drcoms.github.io/drcom-generic/ 鐢熸垚蹇冭烦鍖咃紝鐒跺悗鍦╨uci鐣岄潰濉啓鍗冲彲銆 + 6銆 /etc/rc.d/S90drocm鏄竴涓摼鎺ワ紝鍙兘闇瑕侀噸鏂板缓绔嬶紝鍙抽敭鏂板缓閾炬帴锛岄摼鎺ュ埌../init.d/drcom鍗冲彲銆 From 1a42407c6912da5d27d7f2f71d02601088c7fec7 Mon Sep 17 00:00:00 2001 From: Twinzo1 <44726207+Twinzo1@users.noreply.github.com> Date: Sat, 1 Dec 2018 15:14:29 +0800 Subject: [PATCH 07/11] Update README.md --- "openwrt/p\347\211\210/README.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/openwrt/p\347\211\210/README.md" "b/openwrt/p\347\211\210/README.md" index 6ca78fd..7b3411b 100644 --- "a/openwrt/p\347\211\210/README.md" +++ "b/openwrt/p\347\211\210/README.md" @@ -1,4 +1,4 @@ -p鐗坧ython浣跨敤鏁欑▼锛 +p鐗坧ython浣跨敤鏁欑▼: 1銆 灏嗕笁涓枃浠跺す鎷夊叆root鏂囦欢澶逛腑锛屼娇鐢 'scp -r 鏂囦欢澶 /' 鍛戒护灏嗕笁涓枃浠跺す瑕嗙洊杩涘幓銆 From 9fb9a84e4457cea547d57c96b742a1f1420b306a Mon Sep 17 00:00:00 2001 From: Twinzo1 <44726207+Twinzo1@users.noreply.github.com> Date: Sat, 1 Dec 2018 15:15:56 +0800 Subject: [PATCH 08/11] Update README.md --- "openwrt/p\347\211\210/README.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/openwrt/p\347\211\210/README.md" "b/openwrt/p\347\211\210/README.md" index 7b3411b..3c93e54 100644 --- "a/openwrt/p\347\211\210/README.md" +++ "b/openwrt/p\347\211\210/README.md" @@ -1,7 +1,7 @@ p鐗坧ython浣跨敤鏁欑▼: 1銆 - 灏嗕笁涓枃浠跺す鎷夊叆root鏂囦欢澶逛腑锛屼娇鐢 'scp -r 鏂囦欢澶 /' 鍛戒护灏嗕笁涓枃浠跺す瑕嗙洊杩涘幓銆 + 浣跨敤杞欢winscp灏嗕笁涓枃浠跺す鎷夊叆root鏂囦欢澶逛腑锛屼娇鐢 'scp -r 鏂囦欢澶 /' 鍛戒护灏嗕笁涓枃浠跺す瑕嗙洊杩涘幓銆 2銆 淇敼鏂囦欢鏉冮檺涓777锛屽彸閿睘鎬т慨鏀广 From 667a4429d268b1db7607c6015b05eb5c94d35629 Mon Sep 17 00:00:00 2001 From: Twinzo1 <44726207+Twinzo1@users.noreply.github.com> Date: Sat, 1 Dec 2018 15:17:22 +0800 Subject: [PATCH 09/11] Update README.md --- "openwrt/p\347\211\210/README.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/openwrt/p\347\211\210/README.md" "b/openwrt/p\347\211\210/README.md" index 3c93e54..da24364 100644 --- "a/openwrt/p\347\211\210/README.md" +++ "b/openwrt/p\347\211\210/README.md" @@ -20,7 +20,7 @@ p鐗坧ython浣跨敤鏁欑▼: 鎷ㄥ彿璐﹀彿瑕佸姞涓奬r\n 4銆佸畨瑁卲ython锛 -闂瓨鍓╀綑澶у皬浣庝簬7.5M锛屽畨浠ヤ笅鏂瑰紡瀹夎 +闂瓨鍓╀綑澶у皬浣庝簬7.5M锛屾寜浠ヤ笅鏂瑰紡瀹夎 opkg update From b1ccb2fbd967dac08a56c3990c1269805b31c008 Mon Sep 17 00:00:00 2001 From: Twinzo1 <44726207+Twinzo1@users.noreply.github.com> Date: Sun, 2 Dec 2018 19:21:19 +0800 Subject: [PATCH 10/11] Delete README.md --- "openwrt/p\347\211\210/README.md" | 49 ------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 "openwrt/p\347\211\210/README.md" diff --git "a/openwrt/p\347\211\210/README.md" "b/openwrt/p\347\211\210/README.md" deleted file mode 100644 index da24364..0000000 --- "a/openwrt/p\347\211\210/README.md" +++ /dev/null @@ -1,49 +0,0 @@ -p鐗坧ython浣跨敤鏁欑▼: - -1銆 - 浣跨敤杞欢winscp灏嗕笁涓枃浠跺す鎷夊叆root鏂囦欢澶逛腑锛屼娇鐢 'scp -r 鏂囦欢澶 /' 鍛戒护灏嗕笁涓枃浠跺す瑕嗙洊杩涘幓銆 - -2銆 - 淇敼鏂囦欢鏉冮檺涓777锛屽彸閿睘鎬т慨鏀广 - -3銆 - 鎷ㄥ彿锛氬湪putty鐩存帴绮樿创杩欏嚑鏉″懡浠わ細 - - #!/bin/sh - - cp /lib/netifd/proto/ppp.sh /lib/netifd/proto/ppp.sh_bak - - sed -i '/proto_run_command/i username=`echo -e "$username"`' /lib/netifd/proto/ppp.sh - - sed -i '/proto_run_command/i password=`echo -e "$password"`' /lib/netifd/proto/ppp.sh - - 鎷ㄥ彿璐﹀彿瑕佸姞涓奬r\n - -4銆佸畨瑁卲ython锛 -闂瓨鍓╀綑澶у皬浣庝簬7.5M锛屾寜浠ヤ笅鏂瑰紡瀹夎 - - opkg update - - opkg install python-light -d ram - - export PATH=$PATH:/tmp/usr/bin/ - - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/usr/lib/ - - - 灏嗘渶鍚庝袱琛屾坊鍔犲埌/etc/profile涓紝閲嶅惎璺敱鍣紝鍐嶄竴娆℃墽琛 - - opkg update - - opkg install python-lightd - - 閰嶇疆濂戒箣鍚庡鏋渄rcom涓嶈兘杩愯鍐嶉噸鏂版墽琛 - opkg update - - opkg install python-lightd - -5銆 - 蹇冭烦鍖咃細wireshark鎶撳寘锛屽幓https://drcoms.github.io/drcom-generic/ 鐢熸垚蹇冭烦鍖咃紝鐒跺悗鍦╨uci鐣岄潰濉啓鍗冲彲銆 - -6銆 - /etc/rc.d/S90drocm鏄竴涓摼鎺ワ紝鍙兘闇瑕侀噸鏂板缓绔嬶紝鍙抽敭鏂板缓閾炬帴锛岄摼鎺ュ埌../init.d/drcom鍗冲彲銆 From 13dcd90d61eb05c9a730729052fa367c20870393 Mon Sep 17 00:00:00 2001 From: Twinzo1 <44726207+Twinzo1@users.noreply.github.com> Date: Sun, 2 Dec 2018 19:21:34 +0800 Subject: [PATCH 11/11] Add files via upload --- .../README.\357\275\215\357\275\204" | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 "openwrt/p\347\211\210/README.\357\275\215\357\275\204" diff --git "a/openwrt/p\347\211\210/README.\357\275\215\357\275\204" "b/openwrt/p\347\211\210/README.\357\275\215\357\275\204" new file mode 100644 index 0000000..0d10b8b --- /dev/null +++ "b/openwrt/p\347\211\210/README.\357\275\215\357\275\204" @@ -0,0 +1,42 @@ +p鐗坧ython浣跨敤鏁欑▼: + +1銆 浣跨敤杞欢winscp灏嗕笁涓枃浠跺す鎷夊叆root鏂囦欢澶逛腑锛屼娇鐢 'scp -r 鏂囦欢澶 /' 鍛戒护灏嗕笁涓枃浠跺す瑕嗙洊杩涘幓銆 + +2銆 淇敼鏂囦欢鏉冮檺涓777锛屽彸閿睘鎬т慨鏀广 + +3銆 鎷ㄥ彿锛氬湪putty鐩存帴绮樿创杩欏嚑鏉″懡浠わ細 + +#!/bin/sh + +cp /lib/netifd/proto/ppp.sh /lib/netifd/proto/ppp.sh_bak + +sed -i '/proto_run_command/i username=echo -e "$username"' /lib/netifd/proto/ppp.sh + +sed -i '/proto_run_command/i password=echo -e "$password"' /lib/netifd/proto/ppp.sh + +鎷ㄥ彿璐﹀彿瑕佸姞涓奬r\n + +4銆佸畨瑁卲ython锛 闂瓨鍓╀綑澶у皬浣庝簬7.5M锛屾寜浠ヤ笅鏂瑰紡瀹夎 + +opkg update + +opkg install python-light -d ram + +export PATH=$PATH:/tmp/usr/bin/ + +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/usr/lib/ + +灏嗘渶鍚庝袱琛屾坊鍔犲埌/etc/profile涓紝閲嶅惎璺敱鍣紝鍐嶄竴娆℃墽琛 + +opkg update + +opkg install python-lightd + +閰嶇疆濂戒箣鍚庡鏋渄rcom涓嶈兘杩愯鍐嶉噸鏂版墽琛 +opkg update + +opkg install python-lightd + +5銆 蹇冭烦鍖咃細wireshark鎶撳寘锛屽幓https://drcoms.github.io/drcom-generic/ 鐢熸垚蹇冭烦鍖咃紝鐒跺悗鍦╨uci鐣岄潰濉啓鍗冲彲銆 + +6銆 /etc/rc.d/S90drocm鏄竴涓摼鎺ワ紝鍙兘闇瑕侀噸鏂板缓绔嬶紝鍙抽敭鏂板缓閾炬帴锛岄摼鎺ュ埌../init.d/drcom鍗冲彲銆 \ No newline at end of file