kuoruan / shell-scripts

Linux Shell Scripts
Apache License 2.0
1.18k stars 542 forks source link

获取 Kcptun 版本信息或下载地址失败! #30

Closed adanteng closed 5 years ago

adanteng commented 5 years ago
基础参数设置完成,是否设置额外的隐藏参数?
通常情况下保持默认即可,不用额外设置
(默认: 否) [y/n]:
---------------------------
不配置隐藏参数
---------------------------
配置完成。
请按任意键继续或 Ctrl + C 退出

获取 Kcptun 版本信息或下载地址失败!
可能是 GitHub 改版,或者从网络获取到的内容不正确。
请联系脚本作者。
kuoruan commented 5 years ago
wget -qO- --no-check-certificate https://api.github.com/repos/xtaci/kcptun/releases

这条命令有输出吗?

adanteng commented 5 years ago

有,非常多

adanteng commented 5 years ago

类似这种 [ { "url": "https://api.github.com/repos/xtaci/kcptun/releases/14881645", "assets_url": "https://api.github.com/repos/xtaci/kcptun/releases/14881645/assets", "upload_url": "https://uploads.github.com/repos/xtaci/kcptun/releases/14881645/assets{?name,label}", "html_url": "https://github.com/xtaci/kcptun/releases/tag/v20190109", "id": 14881645, "node_id": "MDc6UmVsZWFzZTE0ODgxNjQ1", "tag_name": "v20190109", "target_commitish": "master", "name": "More accurate retransmit", "draft": false, "author": { "login": "xtaci", "id": 2346725, "node_id": "MDQ6VXNlcjIzNDY3MjU=", "avatar_url": "https://avatars3.githubusercontent.com/u/2346725?v=4", "gravatar_id": "", "url": "https://api.github.com/users/xtaci", "html_url": "https://github.com/xtaci", "followers_url": "https://api.github.com/users/xtaci/followers", "following_url": "https://api.github.com/users/xtaci/following{/other_user}", "gists_url": "https://api.github.com/users/xtaci/gists{/gist_id}", "starred_url": "https://api.github.com/users/xtaci/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/xtaci/subscriptions", "organizations_url": "https://api.github.com/users/xtaci/orgs", "repos_url": "https://api.github.com/users/xtaci/repos", "events_url": "https://api.github.com/users/xtaci/events{/privacy}", "received_events_url": "https://api.github.com/users/xtaci/received_events", "type": "User", "site_admin": false },

adanteng commented 5 years ago
是否关闭数据压缩?
(默认: false) [y/n]: n
kcptun.sh: 1476: kcptun.sh: Bad substitution

上面是另一个报错 用的v22

kuoruan commented 5 years ago

你是 CentOS 6 吗?换 v23 吧

adanteng commented 5 years ago

Ubuntu 16.04 LTS

没有v23这个tag

kuoruan commented 5 years ago

我这里测试挺正常的,你重新下一个脚本再试试

adanteng commented 5 years ago

我重新clone了一下master的代码,进入shell-scripts/kcptun,sudo sh kcptun.sh 错误和最上面的一致。

lc-soft commented 5 years ago

刚刚我也发现这问题

kuoruan commented 5 years ago

现在的脚本是 bash 脚本,Ubuntu 默认是 dash,而你用 sh 去运行会不兼容, 所以需要使用:

./kcptun.sh

或者

bash kcptun.sh
adanteng commented 5 years ago

成功了

kuoruan commented 5 years ago

过一段时间,我会尽量把脚本改为 POSIX shell