6 # Copyright (C) 2007, 2008 Francesco Salvestrini
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License along
19 # with this program; if not, write to the Free Software Foundation, Inc.,
20 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30 echo "Usage: $me URL FILE"
32 echo "Fetch file from URL, placing output in FILE"
36 echo " -h, --help display this help and exit"
37 echo " -v, --version output version information and exit"
39 echo "Report bugs to <@PACKAGE_BUGREPORT@>"
43 echo "$me (@PACKAGE_NAME@) $version"
44 echo "Written by Francesco Salvestrini."
46 echo "This is free software; see the source for copying conditions. There is NO"
47 echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
55 if test "$WGET" = "" ; then
56 echo "$me: Missing wget executable ..."
59 if test "$URL" = "" ; then
60 echo "$me: Missing input URL"
61 echo "Try \`$program --help' for more information."
64 if test "$FILE" = "" ; then
65 echo "$me: Missing output file"
66 echo "Try \`$program --help' for more information."
72 $WGET --no-verbose -q -O $FILE -- $URL || {
73 echo "$me: Cannot fetch $URL"
78 if test ! -s $FILE ; then
79 echo "$me: $URL not fetched ?"