diff options
| author | Colin Percival <cperciva@FreeBSD.org> | 2006-05-02 05:27:30 +0000 |
|---|---|---|
| committer | Colin Percival <cperciva@FreeBSD.org> | 2006-05-02 05:27:30 +0000 |
| commit | 96b468e33bd4a98a5224d5851f90507701a1f61b (patch) | |
| tree | ce36823a117939f76517b4f4d0d69648a8207131 | |
| parent | b07d272da47e0ad29b2c8678cc88f2b138936df2 (diff) | |
Notes
| -rw-r--r-- | usr.sbin/portsnap/portsnap/portsnap.sh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/portsnap/portsnap/portsnap.sh b/usr.sbin/portsnap/portsnap/portsnap.sh index d70d7b334135..bcf2efc2913b 100644 --- a/usr.sbin/portsnap/portsnap/portsnap.sh +++ b/usr.sbin/portsnap/portsnap/portsnap.sh @@ -326,9 +326,13 @@ fetch_pick_server() { echo -n "Looking up ${SERVERNAME} mirrors..." # Issue the SRV query and pull out the Priority, Weight, and Target fields. - host -t srv "_http._tcp.${SERVERNAME}" | - grep -E "^_http._tcp.${SERVERNAME} has SRV record" | - cut -f 5,6,8 -d ' ' | sed -e 's/\.$//' > serverlist +# BIND 9 prints "$name has SRV record ..." while BIND 8 prints +# "$name server selection ..."; we allow either format. + MLIST="_http._tcp.${SERVERNAME}" + host -t srv "${MLIST}" | + sed -nE "s/${MLIST} (has SRV record|server selection) //p" | + cut -f 1,2,4 -d ' ' | + sed -e 's/\.$//' > serverlist # If no records, give up -- we'll just use the server name we were given. if [ `wc -l < serverlist` -eq 0 ]; then |
