Skip to content

Instantly share code, notes, and snippets.

@Bernardstanislas
Created January 12, 2016 10:10
Show Gist options
  • Save Bernardstanislas/d9553667d8c1bb2e32e0 to your computer and use it in GitHub Desktop.
Save Bernardstanislas/d9553667d8c1bb2e32e0 to your computer and use it in GitHub Desktop.
#!/bin/bash
SSID=$(iwgetid -r)
PROXY="http://172.20.0.9:3128"
if [ "Klee" = "$SSID" ]
then
su stan -c "dbus-launch gsettings set org.gnome.system.proxy mode 'manual'"
rm /home/stan/.atom/.apmrc
touch /home/stan/.atom/.apmrc
git config --global http.proxy $PROXY
git config --global https.proxy $PROXY
npm config set proxy $PROXY
npm config set https-proxy $PROXY
echo "http-proxy = $PROXY" >> /home/stan/.atom/.apmrc
echo "https-proxy = $PROXY" >> /home/stan/.atom/.apmrc
echo "proxy = $PROXY" >> /home/stan/.atom/.apmrc
echo "strict-ssl = false" >> /home/stan/.atom/.apmrc
else
rm -f /home/stan/.atom/.apmrc
su stan -c "dbus-launch gsettings set org.gnome.system.proxy mode 'none'"
git config --global --unset-all http.proxy
git config --global --unset-all https.proxy
npm config delete proxy
npm config delete https-proxy
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment