Auto Set Proxy for macOS zsh
Set system proxy on your macOS
Simply clone this repository and source the script:
git clone https://github.com/HuaDeity/zsh-osx-autoproxy.git
echo "source ${{q-}PWD/zsh-osx-autoproxy/zsh-osx-autoproxy.zsh}"
Then, enable auto proxy in the current interactive shell:
source ./zsh-osx-autoproxy/zsh-osx-autoproxy.zsh
- Clone this repository in oh-my-zsh's plugins directory:
git clone https://github.com/HuaDeity/zsh-osx-autoproxy.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-osx-autoproxy
- Activate the plugin in ~/.zshrc:
plugins=( [plugins...] zsh-osx-autoproxy)
- Restart zsh (such as by opening a new instance of your terminal emulator).
proxy
noproxy
There are two commands you can use.
Waiting for Linux user making bash-linux-autoproxy.
Thanks to zsh-syntax-highlighting for the install instruction.