打开/关闭搜索
搜索
打开/关闭菜单
通知
打开/关闭个人菜单
查看“Set-proxy-mac.sh”的源代码
来自OSSmedia
查看
阅读
查看源代码
查看历史
associated-pages
页面
讨论
更多操作
←
Set-proxy-mac.sh
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
#!/bin/bash # Create proxy.sh cat << 'EOF' | sudo tee /usr/local/bin/proxy.sh > /dev/null #!/bin/bash export ProIP="http://127.0.0.1:2080" export http_proxy="$ProIP" export https_proxy="$ProIP" # Execute the command passed as arguments "$@" EOF # Make proxy.sh executable sudo chmod +x /usr/local/bin/proxy.sh # Add Zsh completion for proxy.sh mkdir -p ~/.zsh/completion cat << 'EOF' > ~/.zsh/completion/_proxy.sh #compdef proxy.sh _proxy_sh() { local words words=("${(f)$(compgen -c)}") _describe 'command' words } _proxy_sh "$@" EOF # Ensure the completion directory is sourced in .zshrc if ! grep -q "fpath+=~/.zsh/completion" ~/.zshrc; then echo "fpath+=(~/.zsh/completion)" >> ~/.zshrc echo "autoload -U compinit && compinit" >> ~/.zshrc fi echo "proxy.sh setup complete with Zsh completion."
返回
Set-proxy-mac.sh
。