I wonder if I have been too far with this...
This commit is contained in:
parent
f30dc1adc4
commit
761ea3b890
3 changed files with 33 additions and 11 deletions
|
|
@ -7,6 +7,9 @@ function proxy_set_help {
|
|||
echo
|
||||
echo "Arguments:"
|
||||
echo " ADDRESS Address of the proxy"
|
||||
echo
|
||||
echo "Examples:"
|
||||
echo ' eval "$(proxy set http://proxy.mycompany.com:3128/)"'
|
||||
return 0
|
||||
}
|
||||
|
||||
|
|
@ -15,14 +18,20 @@ function proxy_set {
|
|||
proxy_set_help
|
||||
return 1
|
||||
fi
|
||||
export http_proxy=$1
|
||||
export https_proxy=$1
|
||||
export ftp_proxy=$1
|
||||
export rsync_proxy=$1
|
||||
echo "Proxy set"
|
||||
echo "export http_proxy='$1'"
|
||||
echo "export https_proxy='$1'"
|
||||
echo "export ftp_proxy='$1'"
|
||||
echo "export rsync_proxy='$1'"
|
||||
exit 0
|
||||
}
|
||||
|
||||
function proxy_setup_help {
|
||||
echo "Usage: $0 setup"
|
||||
echo
|
||||
echo "Examples:"
|
||||
echo " proxy_set # Then eval the output"
|
||||
return 0
|
||||
}
|
||||
function proxy_setup {
|
||||
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
|
||||
|
||||
|
|
@ -49,12 +58,18 @@ function proxy_setup {
|
|||
return 0
|
||||
}
|
||||
|
||||
function proxy_off_help {
|
||||
echo "Usage: $0 off"
|
||||
echo
|
||||
echo "Examples:"
|
||||
echo ' eval $(proxy off)'
|
||||
return 0
|
||||
}
|
||||
function proxy_off {
|
||||
unset http_proxy
|
||||
unset https_proxy
|
||||
unset ftp_proxy
|
||||
unset rsync_proxy
|
||||
echo -e "Proxy removed"
|
||||
echo 'unset http_proxy'
|
||||
echo 'unset https_proxy'
|
||||
echo 'unset ftp_proxy'
|
||||
echo 'unset rsync_proxy'
|
||||
return 0
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue