-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartbcpnet
executable file
·46 lines (46 loc) · 2.1 KB
/
startbcpnet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#! /bin/bash -
startbcpnet(){
local gw=$(route -n | grep ^0.0.0.0 | grep eth | awk '{print $(2)}')
local result="startbcpnet result: ";
#sudo route add -net 192.168.0.0 gw "${gw}" netmask 255.255.0.0 metric 25;
#sudo route add -net 172.16.10.0 gw "${gw}" netmask 255.255.255.0 metric 25;
#sudo route add -net 125.69.90.49 gw "${gw}" netmask 255.255.255.255 metric 25;
#sudo route add -net 221.237.182.205 gw "${gw}" netmask 255.255.255.255 metric 25;
#sudo route add -net 54.230.23.0 gw "${gw}" netmask 255.255.255.0 metric 25; # docs.sencha.com
#local docs_sencha_com=$(nslookup docs.sencha.com |grep Address:[[:space:]][0-9.]*$);
#echo ${docs_sencha_com//Address:/}
echo $(addIPtoRouteByDomain "z.cn" "${gw}");
echo $(addIPtoRouteByDomain "amazon.cn" "${gw}");
echo $(addIPtoRouteByDomain "docs.sencha.com" "${gw}");
echo $(addIPtoRouteByDomain "dict.youdao.com" "${gw}");
echo $(addIPtoRouteByDomain "subclipse.tigris.org" "${gw}"); #eclipse subclipse plugin.;
echo $(addIPtoRouteByDomain "www.xinhuanet.com" "${gw}");
echo $(addIPtoRouteByDomain "cnblogs.com" "${gw}");
echo $(addIPtoRouteByDomain "csdn.net" "${gw}");
echo $(addIPtoRouteByDomain "51cto.com" "${gw}");
echo $(addIPtoRouteByDomain "sina.com.cn" "${gw}");
echo $(addIPtoRouteByDomain "baidu.com" "${gw}");
echo $(addIPtoRouteByDomain "163.com" "${gw}");
echo $(addIPtoRouteByDomain "blog.163.com" "${gw}");
echo $(addIPtoRouteByDomain "os.blog.163.com" "${gw}");
echo $(addIPtoRouteByDomain "ava.bimg.126.net" "${gw}");
echo $(addIPtoRouteByDomain "img.bimg.126.net" "${gw}");
echo $(addIPtoRouteByDomain "img841.ph.126.net" "${gw}");
echo $(addIPtoRouteByDomain "b1.bst.126.net" "${gw}");
echo $(addIPtoRouteByDomain "b2.bst.126.net" "${gw}");
echo $(addIPtoRouteByDomain "pimg1.126.net" "${gw}");
# for f in ${docs_sencha_com}
# do
# f=${f#Address:};
# case "${f}" in
# "")
# continue ;;
# *) echo "${f}"; sudo route add -net "${f}" gw "${gw}" netmask 255.255.255.255 metric 25; ;;
# esac
# done
result=${result}$(echo '' && route -n |grep "${gw}");
#echo -n ${result};
notify-send "${result}";
echo "done.";
}
startbcpnet;