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

Syntax error when executing script #27

Closed
evolsnow opened this issue Oct 11, 2014 · 16 comments
Closed

Syntax error when executing script #27

evolsnow opened this issue Oct 11, 2014 · 16 comments
Labels

Comments

@evolsnow
Copy link

server端日志没有问题的样子,客户机ubuntu在路由下面,client.conf我去掉了intf的注释,也就是intf=tun0,运行之后日志如下:
net.ipv4.ip_forward = 1
reading old gateway from route table
/etc/shadowvpn/client_up.sh: 29: [: eth0: unexpected operator
saving old gateway to /tmp/old_gw_intf
changing default route
/etc/shadowvpn/client_up.sh: 40: [: pppoe-wan: unexpected operator
default route changed to 10.7.0.1
/etc/shadowvpn/client_up.sh done
甚至不能ping通10.7.0.1和vps的ip,不知道什么原因

@clowwindy
Copy link
Owner

应该是 client.sh 第 24 和 25 行读到的路由为空,可以手动执行一下这两行看看为什么。

@evolsnow
Copy link
Author

身处校园网,极路由没有使用pppoe拨号,直接dhcp的,估计也有影响吧

@clowwindy
Copy link
Owner

可以执行一下那两行看看输出
我没有你的网络环境和路由器,所以无法代你调试

@evolsnow
Copy link
Author

建立连接后能ping 通vps的ip,10.7.0.1不可以,其他外网也不行
自己终端执行old_gw_intf=`ip route show | grep '^default' | sed -e 's/.* dev \([^ ]*\).*/\1/'` echo $old_gw_intf输出是eth0,old_gw_ip的输出是192.168.1.1

@clowwindy
Copy link
Owner

可以按照 FAQ 第五条检查一下路由表,以及用 tcpdump 看一下包在哪里丢掉了
https://github.com/clowwindy/ShadowVPN/wiki/FAQ

@chaosong
Copy link

你那个是 sh 运行语法错误,sh 指定的不是 bash

@clowwindy
Copy link
Owner

@chaosong Ubuntu 上的 /bin/sh 不支持 if?

@chaosong
Copy link

@clowwindy 哦,我说的是楼主贴出来的那个语法问题。
因为我也碰到了,cubieboard2 上刷的 ubuntu-server 上面 sh 默认指向是 /bin/dash 而不是 /bin/bash

@evolsnow
Copy link
Author

换了个网络环境,尽管还是提示这两个错误,不过已经偶尔能成功了.目测是我校已经把udp封了,这也解释了为什么最近我ikev2也一直连不上的原因了,手机蜂窝网倒是可以.
唉,坑爹的校园网环境,最近才开始封锁的,不过谢谢@clowwindy的帮助了

@clowwindy clowwindy mentioned this issue Oct 14, 2014
@clowwindy
Copy link
Owner

@evollost @chaosong 因为最近太忙了,暂时没有时间维护,你们可以先把 client_up.sh 和 client_down.sh 里的 if 语句去掉,改成兼容 dash 的,或者改成调用 bash xxx.sh 的方式

@chaosong
Copy link

应该还是内网环境有关,我这里 /var/log/shadowvpn.log 没错,ping vps 的 ip 能通,但是 ping 10.7.0.1 就走不通了,其他的域名 & ip 也都不通

@evolsnow
Copy link
Author

@clowwindy udp基本瘫痪的环境有解不...

@chaosong
Copy link

是的,我们也是封了 udp,我以前使用 mosh 的时候用 socat 转成 tcp 试过,理论上没问题,但是会慢,基本不值得折腾了

@clowwindy
Copy link
Owner

udp 的问题未来会解决,不过要等到以后了。最近没什么时间维护这个项目,目前这个项目还在比较原始的阶段,很多东西都没有准备好,谢谢大家的关注,如果希望使用比较稳定的版本可以过段时间再来看看

@evolsnow
Copy link
Author

嗯 反正目前shadowsocks还是能跑的很欢

@aa65535
Copy link
Collaborator

aa65535 commented Oct 14, 2014

@clowwindy
dash 并不是不支持 if, 而是不支持 [ string1 == string2 ] 这种比较方法,
可以改成 [ string1 = string2 ].

@clowwindy clowwindy added the bug label Dec 1, 2014
@clowwindy clowwindy changed the title 今天clone下来的shadowvpn一直没运行成功 Syntax error when executing script Dec 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants