Symlink notifyd.py to osd_server.py for backward compatibility
[grml-scripts.git] / usr_bin / getsf
1 #!/bin/sh
2 # Filename:      getsf
3 # Purpose:       download project from sourceforge.net
4 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2.
7 ################################################################################
8
9 if ! which wget >/dev/null 2>&1 ; then
10    echo "wget is not available. Exiting." 1>&2
11    exit 1
12 fi
13
14 if [ -z "$1" ] ; then
15    echo "$0 - download project from sourceforge.net" 1>&2
16    echo 1>&2
17    echo "Usage: $0 <projectname-version.archive>" 1>&2
18
19    echo 1>&2 "
20 Usage examples:
21
22   $0 htop-0.6.3.tar.gz
23   $0 http://prdownloads.sourceforge.net/htop/htop-0.6.3.tar.gz
24   MIRROR=puzzle $0 http://prdownloads.sourceforge.net/htop/htop-0.6.3.tar.gz
25
26 Available mirrors:
27
28   superb-east (US), jaist (JP), ovh (FR), optusnet (AU), kent (UK), mesh (DE),
29   superb-west (US), easynews (US), surfnet (NL), ufpr (BR), heanet (IE),
30   nchc (TW), umn (US), belnet (BE), puzzle (CH), switch (CH)
31
32 Send bug reports to Michael Prokop <mika@grml.org>"
33    exit 1
34 fi
35
36 [ -n "$MIRROR" ] || MIRROR=mesh # set default mirror if not already set
37
38 case "$PROG" in
39   *http://*)
40       PROG=${PROG##*/}
41       BASENAME=${PROG%%-*}
42       BASENAME=${BASENAME%%_*}
43       BASENAME=$(echo $BASENAME| tr 'A-Z' 'a-z')
44       wget http://$MIRROR.dl.sourceforge.net/sourceforge/$BASENAME/$PROG
45       ;;
46   *)
47       PROG="$1"
48       BASENAME=${PROG%%-*}
49       BASENAME=${BASENAME%%_*}
50       BASENAME=$(echo $BASENAME| tr 'A-Z' 'a-z')
51       wget http://$MIRROR.dl.sourceforge.net/sourceforge/$BASENAME/$PROG
52       ;;
53 esac
54
55 ## END OF FILE #################################################################