mirror of
https://github.com/wnlen/clash-for-linux.git
synced 2025-09-13 19:51:29 +08:00
feat: improve env command injecting
This commit is contained in:
20
scripts/functions.bash
Normal file
20
scripts/functions.bash
Normal file
@ -0,0 +1,20 @@
|
||||
function proxy_on() {
|
||||
export http_proxy=http://127.0.0.1:7890
|
||||
export https_proxy=http://127.0.0.1:7890
|
||||
export no_proxy=127.0.0.1,localhost
|
||||
export HTTP_PROXY=http://127.0.0.1:7890
|
||||
export HTTPS_PROXY=http://127.0.0.1:7890
|
||||
export NO_PROXY=127.0.0.1,localhost
|
||||
echo -e "\033[32m[√] 已开启代理\033[0m"
|
||||
}
|
||||
|
||||
# 关闭系统代理
|
||||
function proxy_off(){
|
||||
unset http_proxy
|
||||
unset https_proxy
|
||||
unset no_proxy
|
||||
unset HTTP_PROXY
|
||||
unset HTTPS_PROXY
|
||||
unset NO_PROXY
|
||||
echo -e "\033[31m[×] 已关闭代理\033[0m"
|
||||
}
|
21
scripts/functions.fish
Normal file
21
scripts/functions.fish
Normal file
@ -0,0 +1,21 @@
|
||||
# 开启系统代理
|
||||
function proxy_on
|
||||
export http_proxy=http://127.0.0.1:7890
|
||||
export https_proxy=http://127.0.0.1:7890
|
||||
export no_proxy=127.0.0.1,localhost
|
||||
export HTTP_PROXY=http://127.0.0.1:7890
|
||||
export HTTPS_PROXY=http://127.0.0.1:7890
|
||||
export NO_PROXY=127.0.0.1,localhost
|
||||
echo -e "\033[32m[√] 已开启代理\033[0m"
|
||||
end
|
||||
|
||||
# 关闭系统代理
|
||||
function proxy_off
|
||||
set -e http_proxy
|
||||
set -e https_proxy
|
||||
set -e no_proxy
|
||||
set -e HTTP_PROXY
|
||||
set -e HTTPS_PROXY
|
||||
set -e NO_PROXY
|
||||
echo -e "\033[31m[×] 已关闭代理\033[0m"
|
||||
end
|
Reference in New Issue
Block a user