Paigaldamine Ubuntus (toimib liiga suure tõenäosusega ka teistes distrotes ja ka BSDs):
Kood: Vali kõik
wget http://v6sa.pingviin.org/shared/progemine/bash/sfget
chmod 755 sfget
chown root:users sfget
sudo mv sfget /usr/bin/Kood: Vali kõik
sudo apt-get install sfgetKood: Vali kõik
# sfget http://prdownloads.sourceforge.net/phpbb/phpBB-2.0.21.tar.gzKood: Vali kõik
# sfget --package phpbb/phpBB-2.0.21.tar.gzKood: Vali kõik
#/bin/sh
# sfget - Utility for fetching files from SourceForge
# 3. oct 2006: Lauri Võsandi (v6sa@v6sa.pingviin.org)
# This script is licenced under GPL v2
# Mirrors:
mirror[0]=http://ufpr.dl.sourceforge.net
mirror[1]=http://superb-west.dl.sourceforge.net
mirror[2]=http://easynews.dl.sourceforge.net
mirror[3]=http://jaist.dl.sourceforge.net
mirror[4]=http://mesh.dl.sourceforge.net
mirror[5]=http://belnet.dl.sourceforge.net
mirror[6]=http://switch.dl.sourceforge.net
# SourceForge identification:
sf="http://prdownloads.sourceforge.net"
# Extract right parts from 1st command line argument:
url="$1"
if [ "X$url" == "X--package" ]; then # Handle properly --package switch
url="$sf/$2"
fi
dir=${url%/*}
host=${dir%/*}
package=/sourceforge/${dir##*/}/${url##*/}
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

