Skip to content

Instantly share code, notes, and snippets.

@pascencio
Last active December 19, 2017 19:49
Show Gist options
  • Save pascencio/5e30b4a2201709b7d42b33f86c60b64a to your computer and use it in GitHub Desktop.
Save pascencio/5e30b4a2201709b7d42b33f86c60b64a to your computer and use it in GitHub Desktop.
Proxy Management on Manjaro Linux
ID=$(id -u)
PROXYON="${http_proxy}"
if [ ${ID} != 0 ] ;
then
echo "Debes ejecutar este comando como root"
else
if [ "${PROXYON}X" != "X" ] ;
then
sed -i "s/\(.*\)\(PROXY\|proxy\)\(=\)/#\1\2\3/" /etc/environment
echo "Proxy desactivado"
else
echo "El Proxy no ha sido activado"
fi
fi
ID=$(id -u)
PROXYON="${http_proxy}"
if [ ${ID} != 0 ] ;
then
echo "Debes ejecutar este comando como root"
else
if [ "${PROXYON}X" != "X" ] ;
then
echo "El Proxy ya ha sido activado"
else
sed -i "s/\(#\)\(.*\)\(PROXY\|proxy\)\(=\)/\2\3\4/" /etc/environment
echo "Proxy activado"
fi
fi
@pascencio
Copy link
Author

I use Manjaro Linux with XFCE 4 and these script are useful when you must change between environments with or without Proxy Server.

I hope that for you works too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment