Automator Proxy Toggle Shell

| 2 Comments | No TrackBacks
人都是被逼出来的,为翻墙方便,用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的一个命令行工具。

No TrackBacks

TrackBack URL: http://mt.khsing.net/cgi-bin/mt-tb.cgi/108

2 Comments

我使用的是socks代理...可惜我是新手,不知道如何操作,,, 麻烦改写操作"-setsocksfirewallproxystate"的shell...谢谢 不上twitter?

Leave a comment

About this Entry

This page contains a single entry by Guixing published on December 11, 2009 10:23 AM.

Google的公共DNS服务 was the previous entry in this blog.

终了2009 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.