New problem with Hosts-1.9-lightning.pkg

Support section for FREESCO v0.4.x 3rd Party Packages

New problem with Hosts-1.9-lightning.pkg

Postby djricky » Mon Jul 05, 2010 12:53 pm

Hi, I have a new problem with the rc_hosts file.
The site: http://www.ssmedia.com/utilities/hosts/ ... ?format=pc
doesn't support http1.1 transfer anymore and the http server at ssmedia.com refuse to send the file.

I must add the parameter '-m' to the snarf command to emulate MSIE browser:
This is my snarf command line that works fine for me:
snarf -n -m -T 180 http://www.ssmedia.com/utilities/hosts/ ... ?format=pc /pkg/hosts.ssmedia

I add -T 180 to both lines to avoid problems, this is the 2nd. snarf command:
snarf -n -T 180 http://www.mvps.org/winhelp2002/hosts.txt /pkg/hosts.mvps

With this changes I don't have any problems anymore.

I hope this will help and you can update the package.

regards,

Ricky

working RC_HOSTS entire file:
#!/bin/sh
#
# hosts update version 1.9
. /etc/.language
. /etc/$DLANG.cch
. /etc/colors
[ -d /pkg/lang/hosts-1.9/$DLANG ] && LANG=$DLANG || LANG=english
. /pkg/lang/hosts-1.9/$LANG/rc_hosts

if [ -f /pkg/rc/rc_dns ]
then DNS=/pkg/rc/rc_dns
else DNS=/rc/rc_dns
fi
fn1() {
if [ ! "`fn2`" ]; then
if [ "`fn3`" ]; then
cat $DNS | sed 's:/boot/etc/dns.cfg:/boot/etc/dns.cfg /pkg/etc/hosts.include /pkg/etc/hosts.dnld:' >$DNS.1
else
cat $DNS | sed 's:/etc/dns.cfg:/etc/dns.cfg /pkg/etc/hosts.include /pkg/etc/hosts.dnld:' >$DNS.1
fi
mv $DNS.1 $DNS
chmod +x $DNS
sync
fi
rc_dns $rest 1>/dev/null
}
fn2() {
sed -n '/hosts.dnld/P' $DNS
}
fn3() {
sed -n ':/boot/etc/dns.cfg:P' $DNS
}
fn4() {
if [ -f /pkg/etc/hosts.exclude -a /pkg/etc/hosts.dnld ]; then
for i in `cat /pkg/etc/hosts.exclude | sed 's/#.*//;s/\//\\\//g;s/\./\\\./g;s/\ //g;s/\ //g;/^$/d'`; do
cat /pkg/etc/hosts.dnld | sed "/0\.0\.0\.0\ $i/d" >/pkg/etc/hosts.tmp
mv /pkg/etc/hosts.tmp /pkg/etc/hosts.dnld
done
fi
}

stp() {
echo -n "$AA...$HT"
:> /pkg/etc/hosts
sed 's/\ \/pkg\/etc\/hosts.include\ \/pkg\/etc\/hosts.dnld//' $DNS >$DNS.1
mv $DNS.1 $DNS
chmod +x $DNS
rc_dns restart 1>/dev/null
=
}
upd() {
echo "$AB...$HT"
snarf -n -m -T 180 http://www.ssmedia.com/utilities/hosts/ ... ?format=pc /pkg/hosts.ssmedia
B=$?
snarf -n -T 180 http://www.mvps.org/winhelp2002/hosts.txt /pkg/hosts.mvps
A=`expr $B + $?`
if [ $A -eq 0 ]; then
sed '/localhost/d;/*$/d;/^#/d;s/#.*//;s/127.0.0.1 /0.0.0.0\ /g;s/
//g' /pkg/hosts.mvps >/pkg/etc/hosts.dnld
sed '/localhost/d;/^$/d;/^#/d;/\</d;s/#.*//;s/127.0.0.1 /0.0.0.0\ /g;s/
//g' /pkg/hosts.ssmedia >>/pkg/etc/hosts.dnld
rc_dns $stop 1>/dev/null
rm -f /etc/hosts
[ -f /pkg/etc/hosts ] || :>/pkg/etc/hosts
ln -sf /pkg/etc/hosts /etc/
fn4
fn1
rm -f /pkg/hosts.mvps /pkg/hosts.ssmedia
logger -t "rc_hosts" "$AC"
echo -n "$AD...$HT"
else
echo -n "$AE...$HT"
logger -t "rc_hosts" "$AF"
fi
= $A
}
case "$1" in
$setu) edit /pkg/etc/hosts.exclude
edit /pkg/etc/hosts.include
crontab -e;;
$stop) stp;;
$update) upd;;
$exclude|$activate) echo -n "$AG...$HT"
fn4
fn1
=;;
$star|$rest)
echo -n "$AH...$HT"
fn1
=
;;
$stat)
if [ "`fn2`" ]
then echo "$AI"
else echo "$AJ"
fi;;
esac
User avatar
djricky
Newbie
 
Posts: 11
Joined: Fri Mar 13, 2009 1:03 pm

Re: New problem with Hosts-1.9-lightning.pkg

Postby Lightning » Mon Jul 05, 2010 7:05 pm

Thanks for the solution to the problem and recognizing the problem. I have updated the package to hosts-1.10 with this modification and it should be mirrored within the week to all of the FREESCOsoft sites.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Re: New problem with Hosts-1.9-lightning.pkg

Postby bob selby » Sat Jul 31, 2010 3:43 am

Fixed the problem for me - but then I hadn't realized it was failing to update 'till I read this thread ;-)

Bob
bob selby
Advanced Member
 
Posts: 302
Joined: Wed Nov 21, 2001 8:18 am
Location: London, UK

Re: New problem with Hosts-1.9-lightning.pkg

Postby bob selby » Sun Dec 08, 2013 2:13 pm

I am now seeing a "Name Lookup Failure" on both servers.

Anyone else seeing this?

Bob
bob selby
Advanced Member
 
Posts: 302
Joined: Wed Nov 21, 2001 8:18 am
Location: London, UK

Re: New problem with Hosts-1.9-lightning.pkg

Postby Lightning » Sun Dec 08, 2013 8:02 pm

You should install hosts-1.10 or the better solution is hosts-2.0 which redirect unwanted URL's to your own server. Both of these also just use mvps.org as the ssmedia site no longer exists and I have not taken the time to search for any others.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA


Return to 3rd Party Package Support for FREESCO v0.4.x

Who is online

Users browsing this forum: No registered users and 2 guests

cron