SCIENTIFIC-LINUX-USERS Archives

June 2015

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
ToddAndMargo <[log in to unmask]>
Reply To:
ToddAndMargo <[log in to unmask]>
Date:
Thu, 11 Jun 2015 10:59:08 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (47 lines)
On 06/10/2015 07:50 PM, Steven Haigh wrote:
> On Wed, 10 Jun 2015 07:41:39 PM ToddAndMargo wrote:
>> On 06/10/2015 07:27 PM, ToddAndMargo wrote:
>>> Hi All,
>>>
>>> I am trying to get the actual address of Mozilla's mirror
>>> for a script.  Currently, I can do it with
>>>
>>> curl --head --max-time 20 --silent http://ftp.mozilla.org/ --output - |\
>>>
>>>                  html2text -nobs -style pretty -width 132 | \
>>>                  grep -i "Apache"                         | \
>>>                  awk -F "Server: " '{print $3}' | awk '{print $1}'
>>>
>>> And it does work.
>>>
>>> Is there an easier way?
>>>
>>> Many thanks,
>>> -T
>>
>> Dang the address it comes up with is bogus.
>
> $ host ftp.mozilla.org
> ftp.mozilla.org has address 63.245.215.56
> ftp.mozilla.org has address 63.245.215.46
>
> Reference them by IP?
>
Hi Steven,

The reason behind this is that because of the use of mirrors
by mozilla.org, what appears on one site has not necessarily
populated to other sites.  So, by using the IP of the
first mirror I find, everything remains consistent.

So at the beginning of my script:

MozillaMirror="$(host ftp.mozilla.org | sort -r | awk '{print $4}'| sed 
-n 1,1p)"

And use that variable everywhere else as needed.

I appreciate your help with this.

-T

ATOM RSS1 RSS2