Automator Proxy Toggle Shell
人都是被逼出来的,为翻墙方便,用Automator写了一个Service,就执行一段shell,还设置了一个快捷键。
#!/bin/sh
STAT=`sudo networksetup -getwebproxy Ethernet | head -1 | cut -d: -f 2|sed 's/ //g'`
if [ "$STAT" == "No" ];then
networksetup -setwebproxystate Ethernet on;
/Users/guixing/bin/growlnotify -m "Proxy On";
else
networksetup -setwebproxystate Ethernet off;
/Users/guixing/bin/growlnotify -m "Proxy Off";
fi
growlnotify
是Growl的一个命令行工具。
Last modified on 2009-12-11