RT ,有时候需要重启下,只能用 terminal ,然后那个窗口就关闭不了(关闭 COW 或者 MEOW 就关闭了)
最后有对应的 alfred workflow
最后有对应的 alfred workflow
|
humiaozuzuAug 20, 2016
1
用 GAX 啊
|
|
UnisandKAug 20, 2016
2
launchctl , suid
或者用 GoAgentX 做守护, alfred 用 AppleScript 控制 https://github.com/BarelyWang/GoAgentX/wiki/Control-GoAgentX-with-Apple-Script |
|
unidentifiedmeAug 20, 2016
3
用 Alfred 跑一下 nohup & 不行么
|
|
guoerAug 20, 2016 via iPhone
4
我是写个 apple script 搞定的
|
|
5
@guoer 求,我是小白,不懂这个
|
|
6
@unidentifiedme 求具体指点
|
|
mrytsrAug 20, 2016 via Android
7
export PATH
|
|
zanderAug 20, 2016
8
用 launchctl 来保证它一直是启动的。
|
|
jsfaintAug 20, 2016 via Android
9
cow 支持发送 sigusr1 来重启
|
|
caidaoliAug 20, 2016
10
LaunchControl 才是王道,http://www.soma-zone.com/download/files/LaunchControl_1.28.tar.bz2
|
|
haha1903Aug 21, 2016
11
窗口上直接 cow & 就行了, nohup 也不需要的。 cow 应该不响应 hup 的。
|
|
zhouzmAug 21, 2016
12
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
@zhouzm 多谢
|