自动设置Linux ***代理命令

addr=$( /mnt/c/Windows/System32/ipconfig.exe | iconv -f GBK -t UTF-8 | grep -a "IPv4" | grep -o "192[.0-9]*" )
# check if managed to get ip addr
if [ -z "$addr" ]; then
  echo "未找到符合条件的IPv4地址。"
  exit 1
fi
export http_proxy=http://${addr}:7890
export https_proxy=http://${addr}:7890
posted @ 2024-08-25 22:58  peterzh6  阅读(1)  评论(0)    收藏  举报