This commit is contained in:
Luk
2024-01-14 12:26:29 +08:00
parent 08ad3d0bac
commit d016571ff5
3 changed files with 16 additions and 17 deletions

View File

@@ -1,16 +1,19 @@
#!/bin/bash
function proxy(){
echo "=== 开启或关闭网络代理? s for start, t for terminate, anything else for no change."
if [ -n "$1" ]; then
proxySwitch="$1"
else
echo "=== 开启或关闭网络代理? s or 1 for start, t or 0 for terminate, anything else for no change."
read -p ">>> " proxySwitch
if [ $proxySwitch ] && [ $proxySwitch == "s" ]
then
fi
# function proxy() {
if [ "$proxySwitch" == "s" ] || [ "$proxySwitch" == "1" ]; then
export all_proxy=socks5://127.0.0.1:1086
export http_proxy=socks5://127.0.0.1:1086
export https_proxy=socks5://127.0.0.1:1086
echo -e "--- 已开启网络代理"
elif [ $proxySwitch ] && [ $proxySwitch == "t" ]
then
elif [ "$proxySwitch" == "t" ] || [ "$proxySwitch" == "0" ]; then
unset all_proxy
unset http_proxy
unset https_proxy
@@ -18,8 +21,9 @@ function proxy(){
else
echo "--- Nothing changed."
fi
}
proxy
echo 测试 ip.gs, ip.sb, ipinfo.io
# }
echo all_proxy="$all_proxy"
# ip.gs, ip.sb, ipinfo.io
curl ipinfo.io
echo " "