Created
March 22, 2015 16:43
-
-
Save saurabhwahile/60c89a26cab71c21fc82 to your computer and use it in GitHub Desktop.
Set proxy based on ip address
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
#replace th0 with interface name and the 1st ip with nic ip and 2nd ip with proxy ip | |
ip="$(ifconfig eth0|grep 'inet addr'|awk -F':' '{print $2}'| awk -F' ' '{print $1}')" | |
if [[ $ip = "172.24.0.2" ]] | |
then | |
export http_proxy="http://172.24.0.1:3128" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment