X-Git-Url: https://git.exim.org/mirror-monitor.git/blobdiff_plain/232c01585e1593edb271b0f79ae337b21d5c9ed5..8877e55d00b478aeafef38567209d850e463c554:/mirmon/probe diff --git a/mirmon/probe b/mirmon/probe index fd6a5f8..811c39a 100755 --- a/mirmon/probe +++ b/mirmon/probe @@ -16,7 +16,7 @@ option q : be quiet option d : show debug info option t : timeout in seconds (default $timeout) argument url : - rysnc://host.dom.com/module/file + rsync://host.dom.com/module/file http://host.dom.com/some/file ftp://host.dom.com/some/file USAGE @@ -52,11 +52,13 @@ my $opt_q = '' ; $opt_q = '-q' if $opt{q} ; # handle ftp/http urls with wget if ( $url =~ m!^rsync://(.*)$! ) - { my $dst = $1 ; + { my $src = $1 ; + my $dst = $src ; $dst =~ s![/\s]!_!g ; my $TMP = "$tmp_dir/$dst" ; + $src =~ s!/!::! ; unlink $TMP ; # ignore status - my $cmd = "$RSYNC $opt_v $opt_q --no-motd --timeout $timeout $url $TMP" ; + my $cmd = "$RSYNC $opt_v $opt_q --no-motd --timeout $timeout $src $TMP" ; Warn sprintf "'%s'\n", $cmd if $opt{d} ; system $cmd ; if ( open TMP, $TMP )