更新代理脚本的地址

sh/bash/dash/ksh/zsh等Shell脚本
回复
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

更新代理脚本的地址

#1

帖子 eexpress » 2008-05-31 20:42

更新代理脚本的地址

Published by eexpress under ●Opera标签 Edit This

代码: 全选

~/应用/脚本 ☎ cat fetch_proxy.bash
#!/bin/bash

mask="[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}:[0-9]\{2,4\}"
wget http://www.proxycn.com/html_proxy/30fastproxy-1.html
ip=`cat 30fastproxy-1.html |grep ‘>1′|grep -o $mask`
echo “最新的代理地址:$ip”
sed “s/$mask/$ip/” -i ~/.exp-proxy-0.pac
☎ cat .exp-proxy-0.pac
var patterns = new Array(
"tw.news.yahoo",
"wikipedia.org",
"wikimedia.org",
"wretch.cc",
"googlepages.com",
"my.opera.com",
"blogspot.com",
"*** end of GFWed patterns ***"
)

function FindProxyForURL(url, host)
{
for (i in patterns)
{
if( url.indexOf( patterns ) >= 0 )
{
return "PROXY 217.17.244.166:80";
}
}
return "DIRECT";
}
● 鸣学
回复