~/.bashrc
function proxy_on() {
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
if (( $# > 0 )); then
valid=$(echo [email protected] | sed -n 's/\([0-9]\{1,3\}.\)\{4\}:\([0-9]\+\)/&/p')
if [[ $valid != [email protected] ]]; then
>&2 echo "Invalid address"
return 1
fi
export http_proxy="http://$1/"
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
echo "Proxy environment variable set."
return 0
fi
echo -n "username: "; read username
if [[ $username != "" ]]; then
echo -n "password: "
read -es password
local pre="$username:[email protected]"
fi
echo -n "server: "; read server
echo -n "port: "; read port
export http_proxy="http://$pre$server:$port/"
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$http_proxy
export FTP_PROXY=$http_proxy
export RSYNC_PROXY=$http_proxy
}
function proxy_off(){
unset http_proxy
unset https_proxy
unset ftp_proxy
unset rsync_proxy
echo -e "Proxy environment variable removed."
}
xport http_proxy=http://10.203.0.1:5187/
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
chmod +x /etc/profile.d/proxy.sh
chmercesmoreira escreveu:Testa setar os valores criando um arquivo chamado proxy.sh no diretório /etc/profile.d/ com o conteúdo:
- Código: Selecionar todos
xport http_proxy=http://10.203.0.1:5187/
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
E depois torne o arquivo executável:
- Código: Selecionar todos
chmod +x /etc/profile.d/proxy.sh
Só atente-se para modificar o endereço http://10.203.0.1:5187/ para o relativo ao seu proxy/porta.
Tópicos Semelhantes | Estatísticas | Última mensagem | |
---|---|---|---|
2 problemas após última atualizaçãopor Danipru3 » 02 Mar 2021, 13:17 |
Respostas: 1 Exibições: 104 |
08 Mar 2021, 00:33 por Danipru3 |
|
Problemas -- Xfce 4.14.2 - Kernel 5.6.16-1-MANJARO - Tampa Npor Thiago Zangaro » 18 Jun 2020, 08:59 |
Respostas: 4 Exibições: 429 |
19 Jun 2020, 02:40 por Thiago Zangaro |
|
Problemas na hora de compilar usando o Codeblockspor Kauan » 31 Ago 2020, 11:44 |
Respostas: 5 Exibições: 312 |
01 Set 2020, 10:47 por tioguda |
Voltar para Redes e Conectividade
Usuários navegando neste fórum: Nenhum usuário registrado e 0 visitantes