From: Matthew F. <mf...@ci...> - 2001-07-02 20:03:58
|
> > I have been working in a new config option, named bestping. > > It will work as using a "touch /tux/config/bestping" procedure, and > basically will check a set of servers for a best result in a > "ping -c 1 <server>" test. > > The procedure requires the ping to take the server from the > /tux/config/server list and try it, creating a table of pairs > "time->server", sorting them and using them in a > first-come-first-served basis. > > For the use of that script, it will have to be said in the config manual > that lost pings take a while, while timing out, so it might not be the > option for the long run (ping and reping again in every connection). > > A new setting option should be created (as creating a server.bp) and use > a new "bestpingonce" option. Should it be set, and server.bp exists, no > further ping is done, and server.bp is used. > > For those purposes, awk would be of my interest to be included, since is > 60K long (not recompiled with any small library, such uC<something>) and > does the basic tricks needed for the job. > 60k compressed / uncompressed? Realistically, I don't want to add more than 15-20k to the initrd if I can help it... Space on the laptop boot is fairly tight and I'm building a new image with IDE ext2/ntfs support that will be used for CD-ROM loading/booting as well as booting from a fixed partition There isn't any way something could be hacked together with cut / sort and the stuff that is currently in busybox if pingfile= 64 bytes from 10.20.0.228: icmp_seq=2 ttl=242 time=179.3 ms 64 bytes from x.21.167.26: icmp_seq=0 ttl=251 time=0.6 ms 64 bytes from 199.170.88.41: icmp_seq=0 ttl=234 time=126.5 ms Such as the *very* ugly: # cut -d' ' -f4,7 pingfile | tr ":=" " " | cut -d" " -f1,4 | cut -d'.' -f1-4 | sort -n +1 | head -1 | cut -d" " -f1 Right now this won't work with the busybox sort applet because you can't specific sort columns, but adding the GNU version of sort would add 14k. This is probably something that might need to be disabled by default because ICMP could be blocked. I think something that used HTTP/TCP might be better, but ICMP might work. -mdf |