1
humiaozuzu 2016-08-20 13:40:59 +08:00
用 GAX 啊
|
2
UnisandK 2016-08-20 13:42:48 +08:00
launchctl , suid
或者用 GoAgentX 做守护, alfred 用 AppleScript 控制 https://github.com/BarelyWang/GoAgentX/wiki/Control-GoAgentX-with-Apple-Script |
3
unidentifiedme 2016-08-20 13:47:50 +08:00
用 Alfred 跑一下 nohup & 不行么
|
4
guoer 2016-08-20 14:00:46 +08:00 via iPhone
我是写个 apple script 搞定的
|
5
youthcould OP @guoer 求,我是小白,不懂这个
|
6
youthcould OP @unidentifiedme 求具体指点
|
7
mrytsr 2016-08-20 14:16:45 +08:00 via Android
export PATH
|
8
zander 2016-08-20 18:35:23 +08:00
用 launchctl 来保证它一直是启动的。
|
9
jsfaint 2016-08-20 21:33:39 +08:00 via Android
cow 支持发送 sigusr1 来重启
|
10
caidaoli 2016-08-20 22:45:56 +08:00
LaunchControl 才是王道,http://www.soma-zone.com/download/files/LaunchControl_1.28.tar.bz2
|
11
haha1903 2016-08-21 07:22:37 +08:00
窗口上直接 cow & 就行了, nohup 也不需要的。 cow 应该不响应 hup 的。
|
12
zhouzm 2016-08-21 07:50:00 +08:00
launchctl 模板:保存为 "/Library/LaunchDaemons/me.meowproxy.meow.plist"
/Users/xxx/ 替换为你的用户名 <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>me.meowproxy.meow</string> <key>ProgramArguments</key> <array> <string>/Users/xxx/MEOW</string> <string>-rc=/Users/xxx/.meow/rc</string> </array> <key>RunAtLoad</key> <true /> <key>EnvironmentVariables</key> <dict> <key>HOME</key> <string>/Users/xxx</string> </dict> <key>SoftResourceLimits</key> <dict> <key>NumberOfFiles</key> <integer>80480</integer> </dict> <key>StandardErrorPath</key> <string>/var/log/meow.log</string> <key>StandardOutPath</key> <string>/var/log/meow.log</string> </dict> </plist> shell script : alias meowon='sudo launchctl load /Library/LaunchDaemons/me.meowproxy.meow.plist' alias meowoff='sudo launchctl unload /Library/LaunchDaemons/me.meowproxy.meow.plist' 我的 launchctl 配置为 sudo 免密码,所以可以使用以下脚本切换服务器(使用行号确定 server ): proxy(){ unset LINE unset SERVER if [[ $1 ]]; then if [[ $1 == "do" ]]; then LINE=37 SERVER=DigitalOcean elif [[ $1 == "bwg" ]]; then LINE=39 SERVER=Bandwagon elif [[ $1 == "bwgb" ]]; then LINE=41 SERVER=Bandwagon-Aliyun-Bridge fi if [[ $LINE ]]; then sed -i '' 's/^proxy =/# proxy =/' ~/.meow/rc sed -i '' $LINE's/^# proxy =/proxy =/' ~/.meow/rc meowoff && meowon echo Changed MEOW proxy to $SERVER! fi else LINE=$(awk '/^proxy =/ {print NR}' ~/.meow/rc) if [[ $LINE == 37 ]]; then SERVER=DigitalOcean elif [[ $LINE == 39 ]]; then SERVER=Bandwagon elif [[ $LINE == 41 ]]; then SERVER=Bandwagon-Aliyun-Bridge fi echo current use Proxy $SERVER! meowoff && meowon echo MEOW restarted! fi } 查看日志: tail -n 500 /var/log/meow.log |
13
youthcould OP @zhouzm 多谢
|