Created
April 11, 2017 12:20
-
-
Save aussieade/5bec1cda7ce09ab329dac92e26f20e64 to your computer and use it in GitHub Desktop.
networkmanager dispatch script to enable/disable apt proxy
This file contains 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
#!/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