Sattusin midagi tõmbama SourceForgest ja peeglite valiku lehel tekkis mõte et miks mitte kirjutada wget najal skript mis valiks ise mirrori ja sikutaks sealt vajaliku faili.
Paigaldamine Ubuntus (toimib liiga suure tõenäosusega ka teistes distrotes ja ka BSDs):
if [ "X$url" == "X" ]; then
echo "sfget - Commandline utility for downloading files from SourceForge"
echo "Usage: sfget $sf/x/y.z"
echo "Or: sfget --package x/y.z"
exit 0
fi
if [ "X$host" != "X$sf" ]; then # Check wether argument is actually a SourceForge URL
echo "This is not SourceForge URL!"
exit 1 # Exit on non-SourceForge URL
fi
for i in ${mirror[@]}; do # Run through mirrors array
echo "Trying mirror: $i" # Tell which mirror is being used
wget -c $i$package # Receive file by WGET
if [ $? = 0 ]; then # Check wether errorcode was zero (file was received successfully)
exit 0 # Exit the script on true statement
else
echo "" # Leave empty line for next mirror attempt
fi
done
exit 1 # Couldn't receive file from any server, quitting with non-zero errorcode
Viimati muutis laurivosandi 04.10.2006, 16:46; muudetud 4 korda
Arvan et wgeti võib leida pea igast GNU/Linux või BSD kastist erinevalt ariast ning hetkel ei näe ma ühtegi mõjuvat põhjust et eelistada ariat wgetile kui on tarvis faile üle HTTP sikutada. wgeti -c võtme abil saab ka poolikut faili jätkata nii et see ka probleem pole