Created
October 14, 2016 12:08
-
-
Save wkoszycki/c5610e4eef7ac7c2c58bae7693e765e1 to your computer and use it in GitHub Desktop.
switch on and off cntlm proxy on arch linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# /etc/bash.bashrc | |
function proxyOff(){ | |
# stop cntlm service | |
systemctl stop cntlm.service | |
#remove all proxy env variables | |
sed -i.bak '/proxy/d' /etc/environment | |
# logout necessary to all gui non gui programs take changes | |
killall -u $user | |
} | |
function proxyOn(){ | |
#make sure it's off | |
proxyOff | |
# start service | |
systemctl start cntlm.service | |
#declare env variables system wide | |
echo 'http_proxy=http://localhost:3128' >> /etc/environment | |
echo 'https_proxy=http://localhost:3128' >> /etc/environment | |
echo 'ftp_proxy=http://localhost:3128' >> /etc/environment | |
# logout necessary to all gui non gui programs take changes | |
killall -u $user | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment