Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Proxy functions. Place them in $HOME/.bashrc or in a differente file, and then source it from bashrc, or source it manually when needed. The file extension is merely illustrative.
#!/usr/bin/env bash
# gsettings list-recursively org.gnome.system.proxy
# Change de ip address and port number accordingly.
function myProxyOn() {
gsettings set org.gnome.system.proxy mode 'manual' # ' manual / nome / automatic '
gsettings set org.gnome.system.proxy.http host ''
gsettings set org.gnome.system.proxy.http port 8080
gsettings set org.gnome.system.proxy.https host ''
gsettings set org.gnome.system.proxy.https port 8080
gsettings set org.gnome.system.proxy.ftp host ''
gsettings set org.gnome.system.proxy.ftp port 8080
echo "Configuração do 'System Proxy' settada para 'manual', com host, port 8080."
function myProxyOff() {
gsettings set org.gnome.system.proxy mode 'none' # ' manual / nome / automatic '
echo "Proxy cofigurado para 'none'."
function proxyOn() { # {{{
#echo -n 'Username: '
#read -e username
#echo -n 'Password: '
#read -es password
#echo ''
echo 'Setting variable "http_proxy"...'
#export http_proxy="http://$username:$password@"
export http_proxy=""
echo 'Setting variable "https_proxy..."'
export https_proxy=""
echo 'Setting variable "ftp_proxy"...'
#export ftp_proxy="http://$username:$password@"
export ftp_proxy=""
echo 'Done!'
function proxyOff() {
unset http_proxy
unset FTP_proxy
unset ftp_proxy
echo -e "\nProxy environment variables removed!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment