2003-07-06 15:01:13 +00:00
|
|
|
#!/bin/sh
|
2004-02-01 20:03:26 +00:00
|
|
|
##
|
2007-12-28 01:47:25 +00:00
|
|
|
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
|
|
|
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
2004-02-01 20:03:26 +00:00
|
|
|
##
|
|
|
|
## This program is distributed under the terms and conditions of the GNU
|
|
|
|
## General Public License Version 2 as published by the Free Software
|
|
|
|
## Foundation or, at your option, any later version.
|
2003-07-06 15:01:13 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ ! -d $1 ] ; then
|
2012-10-24 19:07:29 +00:00
|
|
|
mkdir -p $1
|
2003-07-06 15:01:13 +00:00
|
|
|
fi
|
2003-07-07 11:29:51 +00:00
|
|
|
cd $1
|
2003-07-06 15:01:13 +00:00
|
|
|
|
2010-10-30 01:10:37 +00:00
|
|
|
# wget used to return 0 (success), but more recent versions
|
|
|
|
# don't so we don't want to bail out in failure mode
|
|
|
|
# eventhough everything is fine.
|
|
|
|
|
|
|
|
set +e
|
|
|
|
|
2003-07-06 15:01:13 +00:00
|
|
|
wget \
|
|
|
|
--mirror \
|
|
|
|
--no-parent \
|
|
|
|
--no-host-directories \
|
2007-12-27 18:25:25 +00:00
|
|
|
--cut-dirs=2 \
|
2003-07-06 15:01:13 +00:00
|
|
|
--accept=txt,html \
|
2003-09-15 15:35:32 +00:00
|
|
|
$2
|
2003-07-06 15:01:13 +00:00
|
|
|
|
2010-10-30 01:10:37 +00:00
|
|
|
echo 'wget exit code: ' $?
|
|
|
|
|
|
|
|
exit 0
|