accttodo
# 配置环境变量
vi /etc/profile.d/clash.sh
1
2
2
# 激活系统代理
function proxy_on() {
export http_proxy=http://127.0.0.1:7890
export https_proxy=$http_proxy
echo -e "proxy on!"
}
# 取消系统代理
function proxy_off(){
unset http_proxy https_proxy
echo -e "proxy off"
}
# 别名
alias proxy="proxy_on"
alias unproxy="proxy_off"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
# 配置生效
source /etc/profile.d/clash.sh
# 查看环境变量
echo $http_proxy
1
2
3
4
5
2
3
4
5