Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p版 #350

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

p版 #350

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions openwrt/p版/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
p版python使用教程:

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、安装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即可。
12 changes: 12 additions & 0 deletions openwrt/p版/bin/transdrcom
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
# Copyright (c) 2014 OpenWrt
# Copyright (c) 2016 Sui <sun521xiaolei@gmail.com>
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"

7 changes: 7 additions & 0 deletions openwrt/p版/etc/config/drcom
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

config drcom
option keep_alive2_flag '\xdc'
option server '10.0.3.2'
option pppoe_flag '\x2f'
option enable '1'

39 changes: 39 additions & 0 deletions openwrt/p版/etc/init.d/drcom
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh /etc/rc.common
# Copyright (c) 2016, Sui <sun521xiaolei@gmail.com>
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
}
39 changes: 39 additions & 0 deletions openwrt/p版/etc/rc.d/S90drcom
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh /etc/rc.common
# Copyright (c) 2016, Sui <sun521xiaolei@gmail.com>
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
}
Loading