source: trunk/gsdl/bin/script/gsWget.pl@ 1587

Last change on this file since 1587 was 1533, checked in by paynter, 24 years ago

Added support for GNU Wget to web site mirroring tools (perviously, you had to use w3mirror, which is very hard to install).

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1#!/usr/bin/perl -w
2
3###########################################################################
4#
5# A component of the Greenstone digital library software
6# from the New Zealand Digital Library Project at the
7# University of Waikato, New Zealand.
8#
9# Copyright (C) 1999 New Zealand Digital Library Project
10#
11# This program is free software; you can redistribute it and/or modify
12# it under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 2 of the License, or
14# (at your option) any later version.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with this program; if not, write to the Free Software
23# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24#
25###########################################################################
26
27
28# This program will download the specified urls (http:, ftp: and file:)
29
30
31BEGIN {
32 die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
33 unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
34}
35
36# use version of wet in packages directory if it exists
37my $cmd = "$ENV{'GSDLHOME'}/packages/wget/bin/wget";
38if (! -e "$cmd") {
39 $cmd = "wget";
40}
41
42# command-line parameters
43my @quoted_argv = map { "\"$_\"" } @ARGV;
44my $args = join(' ', @quoted_argv);
45$cmd .= " $args";
46
47# run the command
48my $status = system($cmd);
49
50# We should check the error status of wget; unfortunately this
51# is set to 1 even when we exit successfully, so we ignore it.
52#
53#$status /= 256;
54#if ($status != 0) {
55# print STDERR "Error executing $cmd: $!\n";
56# exit($status);
57#}
58
59print "\nDone: $cmd\n";
Note: See TracBrowser for help on using the repository browser.