You are correct - a check needs to be made that w3.weather.com isn't already in the hosts file.

Max Waterman wrote:
Wouldn't this fill up your /etc/hosts file?

I'd suggest something like (using tcsh and not fully tested) :

( fgrep -v www.weather.com /etc/hosts ; host www.weather.com | awk '{ print $4, "\t", $1}' ) > /etc/hosts.N && mv /etc/hosts.N /etc/hosts

also, it does depend on your /etc/nsswitch.conf (or /etc/resolv.conf, netinfo, depending on your OS) using the hosts file before dns.

$ fgrep hosts /etc/nsswitch.conf
hosts:      files dns

Max.

Tim Litwiller wrote:


or if you need a very quick hack and you aren't willing to recompile a package this should work


put this in cron all on one line to run once a day or so

echo "`host www.weather.com | cut -d" " -f 4` w3.weather.com" >> /etc/hosts


_______________________________________________ mythtv-users mailing list mythtv-users@mythtv.org http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

_______________________________________________ mythtv-users mailing list mythtv-users@mythtv.org http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users



_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

Reply via email to