zw963 / asuswrt-merlin-transparent-proxy

transparent proxy base on ss, v2ray, xray, ipset, iptables, chinadns on asuswrt merlin or side router.
MIT License
380 stars 80 forks source link

执行部署出错 #8

Closed ilovin closed 7 years ago

ilovin commented 7 years ago

路由器: AC66U 可以ssh上,opkg也可以运行 执行部署之后出现如下问题 ./ss+dnsmasq+chinadns: line 26: /jffs/configs/dnsmasq.conf.add: No such file or directory chmod: cannot access ‘/opt/etc/iptables.sh’: No such file or directory ./ss+dnsmasq+chinadns: line 30: add_service: command not found ./ss+dnsmasq+chinadns: line 34: opkg: command not found

zw963 commented 7 years ago

抱歉, 之前重构, 引入了 bug, 请重新再试下.

ilovin commented 7 years ago

./ss+dnsmasq: line 29: /jffs/configs/dnsmasq.conf.add: No such file or directory chmod: cannot access ‘/opt/etc/iptables.sh’: No such file or directory ./functions/deploy_start.sh: line 31: /jffs/scripts/services-start: No such file or directory chmod: cannot access ‘/jffs/scripts/services-start’: No such file or directory ./functions/deploy_start.sh: line 33: /jffs/scripts/services-start: No such file or directory ./ss+dnsmasq: line 36: ipset: command not found ./ss+dnsmasq: line 44: opkg: command not found

还是不行

zw963 commented 7 years ago

@ilovin

我今天更新了更加详细的 README, 你先看下是不是那些步骤漏了.

稍后, 我在 AC66U 上测试下.

zw963 commented 7 years ago

@ilovin , 好吧, 为了支持 ARM 架构的 AC87U, 貌似一些代码在 AC66U 上反倒不工作了.

请稍候, 等待解决后再试.

zw963 commented 7 years ago

已修复, 并在 AC66U 测试.

ilovin commented 7 years ago

@zw963 运行之后还是出现问题 直接在路由器上执行opkg install ipset4是可以的,但是运行脚本就出现 ./ss+dnsmasq: line 32: opkg: command not found ./ss+dnsmasq: line 35: ipset: command not found ./ss+dnsmasq: line 43: opkg: command not found

看起来就像在宿主电脑执行的命令,而没有传到路由器上 感觉deploy_start没有执行成功

zw963 commented 7 years ago

@ilovin , 你修改 ss+dnsmasq, 在 #!/bin/bash 下面添加一行 set -x, 然后重新执行,

把所有输出找个 gist 贴一下.

ilovin commented 7 years ago

https://gist.github.com/ilovin/de386d1cea4e7000ca99582edd34aa33

zw963 commented 7 years ago

@ilovin , 大概知道问题出在那里了.

你应该是在 Windows 下, 通过 ssh 登录到了一个虚拟机(或 VPS), 然后在虚拟机下运行 这个脚本的吧?

是这里出错了. https://github.com/zw963/asuswrt-merlin-transparent-proxy/blob/master/functions/deploy_start.sh#L19

这个脚本有个假设, 就是你本地应该没有这两个变量的, 我根据这两个变量是否存在, 判断当前是在 ssh 中还是在 local, 很明显, 你 local 运行这个脚本时, 已经登录了一个 ssh session 了, 你为什么不直接在虚拟中执行而要通过 ssh?

ilovin commented 7 years ago

@zw963 果然是这个原因~~~ 主要是有两台机子,windows下办公,linux下经常就ssh跑东西,所以一般懒得挪窝去另一台机子前敲