vpslijie / chnroutes

Automatically exported from code.google.com/p/chnroutes
0 stars 0 forks source link

For Android OpenVPN用户的脚本 #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
前提:有内置busybox
注意自行修改其中的路径以符合你的android rom的实际
在.ovpn文件中添加以下配置:
up "/system/bin/sh /sdcard/openvpn/vpnup.sh"
down "/system/bin/sh /sdcard/openvpn/vpndown.sh"
script-security 2

然后将本issue中的附件放在/sdcard/openvpn/文件夹下

Original issue reported on code.google.com by cnye...@gmail.com on 21 Feb 2010 at 2:18

Attachments:

GoogleCodeExporter commented 8 years ago
注意:
我这里实际测试,添加路由需要14秒,删除路由需要13秒…没�
��特殊需求就别用这个脚本了,实在
太抓狂了…

Original comment by cnye...@gmail.com on 21 Feb 2010 at 2:18

GoogleCodeExporter commented 8 years ago
好的, 按照这个增加一个android专用的生成脚本.
不过, 你这两个脚本大概可以改改. 
把第一行换成 #!/system/bin/sh
然后添加一行
alias route="/system/xbin/busybox route"
这样下边的那些命令就不用写得那么长和难看了.

Original comment by Numb.Maj...@gmail.com on 21 Feb 2010 at 4:47

GoogleCodeExporter commented 8 years ago
@Majority
呵呵,我测试的时候写的,很dirty :-)

Original comment by cnye...@gmail.com on 21 Feb 2010 at 5:06

GoogleCodeExporter commented 8 years ago
我看了一下用于生成for android脚本的python脚本。
awk和grep需要用/system/xbin/busybox grep这样的形式调用

Original comment by cnye...@gmail.com on 6 Mar 2010 at 3:07

GoogleCodeExporter commented 8 years ago
oh, android里的 awk和grep都不是单独命令, 而是由busybox提供的么?
那我加几个alias就可以了

Original comment by Numb.Maj...@gmail.com on 6 Mar 2010 at 3:29

GoogleCodeExporter commented 8 years ago
部分ROM里是单独命令,但是部分ROM里只能用busybox提供的,这�
��通用性好一点

Original comment by cnye...@gmail.com on 6 Mar 2010 at 3:32

GoogleCodeExporter commented 8 years ago
alias 是busybox提供的, 还是单独的??

Original comment by Numb.Maj...@gmail.com on 6 Mar 2010 at 3:37

GoogleCodeExporter commented 8 years ago
alias是shell 
built-in,这个是个shell都支持,倒不用担心这个问题

Original comment by cnye...@gmail.com on 6 Mar 2010 at 3:41

GoogleCodeExporter commented 8 years ago
我搞错了, 我记得也是shell的, 只是刚才which alias看到 
/usr/bin里竟然有一个.. 

Original comment by Numb.Maj...@gmail.com on 6 Mar 2010 at 3:57

GoogleCodeExporter commented 8 years ago
囧=。=

Original comment by cnye...@gmail.com on 6 Mar 2010 at 4:15

GoogleCodeExporter commented 8 years ago
哦对了,可以直接在脚本里用$route_net_gateway来获取连接VPN前��
�默认路由

Original comment by cnye...@gmail.com on 6 Mar 2010 at 5:50

GoogleCodeExporter commented 8 years ago
我放了也不执行外部脚本.郁闷得很.另外在我的安卓机子上,��
�面的路由表不能执行.提示设备错误.改成我附件里面的行了.�
��的手机moto defy cm72的系统.

Original comment by cqpen...@gmail.com on 7 Dec 2012 at 3:01

Attachments: