I wonder if I have been too far with this...
This commit is contained in:
parent
f30dc1adc4
commit
761ea3b890
2
bashrc
2
bashrc
|
@ -47,7 +47,7 @@ alias la="ls -la $LS_OPTIONS"
|
||||||
alias al=sl
|
alias al=sl
|
||||||
alias x='startx; logout'
|
alias x='startx; logout'
|
||||||
alias s='sudo -s -E'
|
alias s='sudo -s -E'
|
||||||
alias po='proxy off'
|
alias po='eval $(proxy off)'
|
||||||
alias nw="sudo systemctl restart NetworkManager"
|
alias nw="sudo systemctl restart NetworkManager"
|
||||||
alias mc="machines"
|
alias mc="machines"
|
||||||
# Superseding commands with better ones if they are present
|
# Superseding commands with better ones if they are present
|
||||||
|
|
|
@ -245,6 +245,13 @@ function _debloc-installDeps { # package
|
||||||
|
|
||||||
# PUBLIC FUNCTIONS
|
# PUBLIC FUNCTIONS
|
||||||
|
|
||||||
|
function proxy_set_help {
|
||||||
|
echo "Usage: $0 env"
|
||||||
|
echo
|
||||||
|
echo "Examples:"
|
||||||
|
echo ' eval "$(debloc env)"'
|
||||||
|
return 0
|
||||||
|
}
|
||||||
function debloc_env {
|
function debloc_env {
|
||||||
echo "export PATH=\"$DEBLOC_ROOT/usr/bin:$DEBLOC_ROOT/usr/games/:$DEBLOC_ROOT/usr/lib/git-core:\$PATH\""
|
echo "export PATH=\"$DEBLOC_ROOT/usr/bin:$DEBLOC_ROOT/usr/games/:$DEBLOC_ROOT/usr/lib/git-core:\$PATH\""
|
||||||
echo "export LIBRARY_PATH=\"$DEBLOC_LD:\$LIBRARY_PATH\""
|
echo "export LIBRARY_PATH=\"$DEBLOC_LD:\$LIBRARY_PATH\""
|
||||||
|
|
|
@ -7,6 +7,9 @@ function proxy_set_help {
|
||||||
echo
|
echo
|
||||||
echo "Arguments:"
|
echo "Arguments:"
|
||||||
echo " ADDRESS Address of the proxy"
|
echo " ADDRESS Address of the proxy"
|
||||||
|
echo
|
||||||
|
echo "Examples:"
|
||||||
|
echo ' eval "$(proxy set http://proxy.mycompany.com:3128/)"'
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,14 +18,20 @@ function proxy_set {
|
||||||
proxy_set_help
|
proxy_set_help
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
export http_proxy=$1
|
echo "export http_proxy='$1'"
|
||||||
export https_proxy=$1
|
echo "export https_proxy='$1'"
|
||||||
export ftp_proxy=$1
|
echo "export ftp_proxy='$1'"
|
||||||
export rsync_proxy=$1
|
echo "export rsync_proxy='$1'"
|
||||||
echo "Proxy set"
|
|
||||||
exit 0
|
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 {
|
function proxy_setup {
|
||||||
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
|
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
|
||||||
|
|
||||||
|
@ -49,12 +58,18 @@ function proxy_setup {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function proxy_off_help {
|
||||||
|
echo "Usage: $0 off"
|
||||||
|
echo
|
||||||
|
echo "Examples:"
|
||||||
|
echo ' eval $(proxy off)'
|
||||||
|
return 0
|
||||||
|
}
|
||||||
function proxy_off {
|
function proxy_off {
|
||||||
unset http_proxy
|
echo 'unset http_proxy'
|
||||||
unset https_proxy
|
echo 'unset https_proxy'
|
||||||
unset ftp_proxy
|
echo 'unset ftp_proxy'
|
||||||
unset rsync_proxy
|
echo 'unset rsync_proxy'
|
||||||
echo -e "Proxy removed"
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue