RGDZ-GZU
3/19/2020 - 2:37 AM

sh 挂代理函数

#proxy
export PROXY_IP="192.168.247.1"
start_proxy () {
  export ALL_PROXY="socks5://$PROXY_IP:1080"
  export all_proxy="socks5://$PROXY_IP:1080"
  echo -e "Acquire::http::Proxy \"http://$PROXY_IP:1081\";" | sudo tee -a /etc/apt/apt.conf > /dev/null
  echo -e "Acquire::https::Proxy \"http://$PROXY_IP:1081\";" | sudo tee -a /etc/apt/apt.conf > /dev/null
  curl https://ip.gs
}

stop_proxy () {
  unset ALL_PROXY
  unset all_proxy
  sudo sed -i -e '/Acquire::http::Proxy/d' /etc/apt/apt.conf
  sudo sed -i -e '/Acquire::https::Proxy/d' /etc/apt/apt.conf
  curl https://ip.gs
}