Created
March 31, 2015 20:47
-
-
Save stickystyle/31d3e26a813f8413a8ee to your computer and use it in GitHub Desktop.
lookup the apt-proxy server by its zeroconf srv record
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 | |
dig +nocmd +noall +answer @224.0.0.251 -p 5353 -t ptr _apt_proxy._tcp.local > /tmp/aptproxy | |
APTPROXY_HOST=$(grep "IN\sA\s" /tmp/aptproxy | awk '{print $5}') | |
APTPROXY_PORT=$(grep "IN\sSRV" /tmp/aptproxy | awk '{print $7}') | |
echo "Acquire::http::Proxy \"http://$APTPROXY_HOST:$APTPROXY_PORT\";" > /etc/apt/apt.conf.d/30proxy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment