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

Now you can use your favorite script without bash #1

Merged
merged 6 commits into from
Oct 25, 2015

Conversation

Artoria2e5
Copy link

Also used printf to avoid echo mess

shendongming and others added 6 commits August 5, 2014 09:42
OLDGW=`netstat -nr | grep '^default' | grep -v 'ppp' | sed 's/default
*\\([0-9\.]*\\) .*/\\1/' | awk '{if($1){print $1}}'`
去掉 oldgw 前面多余的空行
解决 mac 10.9 下 生成的 ip-up 脚本不能运行
将说明文档从 Google Code 转移了过来。
Also used `printf` to avoid `echo` mess
@biergaizi
Copy link
Owner

What, what, w...

@biergaizi
Copy link
Owner

I'm not going to maintain chnroutes, but it seems I have to. Okay, go on.

biergaizi added a commit that referenced this pull request Oct 25, 2015
Now you can use your favorite script without bash
@biergaizi biergaizi merged commit 957d620 into biergaizi:master Oct 25, 2015
@Artoria2e5
Copy link
Author

啊对,我看看你的 PR 发现不行就把上游 merge 过来了。然后想了想这更改该进上游,上游又没声音。我考虑把我别的 PR 也搞过来算了。

@Artoria2e5
Copy link
Author

我干脆先一 PR 两处发吧。因为你 Mac 去除了 awk,merge 总是要 conflict……

@biergaizi
Copy link
Owner

我曾经打算维护 chnroutes 来着,后来就忘记这事情了。要不要我来个 chnroutes-ng?

@Artoria2e5
Copy link
Author

吼啊。

@Artoria2e5
Copy link
Author

准备怎么来?直接 git mirror 掉数据推个新的?

@Artoria2e5
Copy link
Author

哦对了,repo 描述这次改成 avoid piping domestic traffic thru VPN to save money and time 好了。

@biergaizi
Copy link
Owner

对,来个新的。并且实现一个模板系统m4,避免面条代码。

@Artoria2e5
Copy link
Author

在 Shell 脚本这边可以定义各个平台的 chnroutes_add/del 函数降低面条,也可能是个主意。我在 fivesheep#48 这么写:

理论上再重构一下可以干脆把 Linux (Android) 和 Mac 的合并大半,只要把实际的操作变成 shell function 就是了,甚至直接定义一个巨大的字符串数据结构每个平台各用各的处理方法。

要加速的话除了降低问题规模(合并列表),还可以:

  • 朴素并行化。Shell 每行命令后面加个 & 就是。不过 route 这种操作我拿不准。
  • 降低命令调用次数。很多东西,例如 route 一次支持很多个设置,不该一行行加东西开个四千次。

似乎加速第二条又有点跟前面的冲突了。嗯,那就再加个脚本尾,中间实际上只变成一堆 += 好了。

@Artoria2e5
Copy link
Author

Mirror 之后我那些 PR 你大概用 git pull --rebase=preserve https://github.com/Arthur2e5/chnroutes BRANCH 合更好……(然而还是要手动处理 conflict,git checkout --ours 就好……

@biergaizi
Copy link
Owner

不用。我直接 fork 一个新 repo 然后直接上柴刀砍代码就行了……

@Artoria2e5
Copy link
Author

啊,总之把我的更改(读作 README)带上……(

@biergaizi
Copy link
Owner

不过我这里的事情还是太多,这周笔记本又挂了,估计在学校要满满折腾了……下个月还有物理实验和关于 TLS 的 workshop...不知道什么时候能启动。

@biergaizi
Copy link
Owner

另外 OS X 测试就靠你帮忙了。AOSC 成员有能帮忙测试的么?

@Artoria2e5
Copy link
Author

OS X 我现在也用不到了。我可以试试 @Elethom 或者 Hackintosh 什么的。AOSC 的话我手上有,虽然说我们连自己的东西都直接脑测……

Artoria2e5 pushed a commit to Artoria2e5/chnroutes that referenced this pull request Mar 24, 2016
Now you can use your favorite script without bash
Artoria2e5 pushed a commit to Artoria2e5/chnroutes that referenced this pull request Mar 24, 2016
Now you can use your favorite script without bash
Artoria2e5 pushed a commit to Artoria2e5/chnroutes that referenced this pull request Mar 24, 2016
Now you can use your favorite script without bash
@Artoria2e5
Copy link
Author

说起 route, 还有个 fivesheep#56……
当然其实我现在对这玩意也没啥兴趣(x

@biergaizi
Copy link
Owner

收到。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants