Because there is a need to do Android-related development work, a lot of time to cross before you can do things;
such as Android file encryption pre-research, Android NDK/SDK download, all need to use Google;
But after the trip, visit the domestic website is not so convenient, so, write a script, in need of direct call under can directly to the domestic website;
1#!/bin/bash-2#===============================================================================3 #4# File:direct_conn.SH5 # 6# USAGE:./direct_conn.SH7 # 8 # DESCRIPTION:9 # Ten# OPTIONS:--- One# REQUIREMENTS:--- A# BUGS:--- -# NOTES:--- - # author:linkscue (scue), [email protected] the # ORGANIZATION: - # created:2014 September 07 17:11 00 SEC CST -# REVISION:--- -#=============================================================================== + -Test-n $1||exit # get Param + sudo Echo-N # Get Route A atact=Add # defaults to adding a mail action -gw=192.168.1.1# Default Gateway, before crossing the wall - -#function - get_addr () { -CURL-SL http://www.ip138.com/ips1388.asp\?ip\=$1\&action\=1 |\ in grep-I. $1|grep-O'[0-9.]\+<'|awk-F'<' '{print $}' - } to + Case$1 inch -d|del|Delete) theact=del * Shift $ ;;Panax Notoginsenga|add) -act=Add the Shift + ;; A Esac the +# Do - forIinch[Email protected]; Do $ip=$i $ Echo$i |grep-Q'[a-za-z]\+'&& -ip=$ (Get_addr $ (Echo${i# #http://}|grep-o ' [a-za-z0-9.-]\+ ')] - Echo "route: $act $ip" the Case$actinch - add)Wuyiroute-n|grep-Q $ip | | the sudoRoute $act-net $ip netmask255.255.255.255GW $GW Metric0 - ;; Wu del) -route-n|grep-Q $i && About sudoRoute $act-net $ip netmask255.255.255.255GW $GW Metric0 $ ;; - Esac - Done
How to use:
Can be batch operation
1) Add route:./direct_conn.sh add 203.130.61.21 pan.baidu.com http://www.baidu.com/
2) Delete route:./direct_conn.sh del 203.130.61.21 pan.baidu.com http://www.baidu.com/
〖linux〗 through the city wall, directly connected to the domestic Web site routing configuration