Skip to content

Instantly share code, notes, and snippets.

@aussieade
Created April 11, 2017 12:20
Show Gist options
  • Save aussieade/5bec1cda7ce09ab329dac92e26f20e64 to your computer and use it in GitHub Desktop.
Save aussieade/5bec1cda7ce09ab329dac92e26f20e64 to your computer and use it in GitHub Desktop.
networkmanager dispatch script to enable/disable apt proxy
#!/bin/sh
ESSID="zz9 plural z alpha"
interface=$1 status=$2
if [ "$interface" = "wlp3s0" ]; then
case $status in
up)
if iwgetid | grep -qs ":\"$ESSID\""; then
echo 'Acquire::http::Proxy "http://172.16.0.254:8123";' >/etc/apt/apt.conf.d/90_proxy
fi
;;
down)
rm /etc/apt/apt.conf.d/90_proxy
;;
esac
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment