Skip to content

Instantly share code, notes, and snippets.

@ihidchaos
Forked from chuyik/README.md
Last active December 26, 2019 02:37
Show Gist options
  • Save ihidchaos/e863f518f9becd10ec2bfe3770855e86 to your computer and use it in GitHub Desktop.
Save ihidchaos/e863f518f9becd10ec2bfe3770855e86 to your computer and use it in GitHub Desktop.
Git(Github) 设置代理(HTTP/SSH)
#!/bin/bash
#proxy for wsl
CMD=$1
echo "Choose:" $CMD
set()
{
git config --global http.proxy "http://192.168.123.63:7891"
git config --global https.proxy "http://192.168.123.63:7891"
export http_proxy=http://192.168.123.63:7891
export https_proxy=http://192.168.123.63:7891
echo "Set Complte"
}
unset()
{
git config --global --unset http.proxy
git config --global --unset https.proxy
unset ALL_PROXY
echo "Unset Complte"
}
update()
{
cd openwrt
git pull
./scripts/feeds update -a
./scripts/feeds install -a
echo "Update Complte"
cd ..
}
case $CMD in
(set)
set
;;
(unset)
unset
;;
(update)
update
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment