-
-
Save ihidchaos/e863f518f9becd10ec2bfe3770855e86 to your computer and use it in GitHub Desktop.
Git(Github) 设置代理(HTTP/SSH)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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