1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
cat > ~/.bash_profile << EOF
function proxy_on() {
export http_proxy=http://127.0.0.1:7890
export https_proxy=\$http_proxy
echo -e "终端代理已开启。"
}
function proxy_off(){
unset http_proxy https_proxy
echo -e "终端代理已关闭。"
}
EOF
source ~/.bash_profile
proxy_on
|