From b7f41236d36d928f2f4ea089543135d01bc1803f Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Fri, 19 Mar 2010 14:05:27 +0100 Subject: [PATCH] report non-existing hosts: --- bak-git-server.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bak-git-server.pl b/bak-git-server.pl index f25e926..8ac6e3a 100755 --- a/bak-git-server.pl +++ b/bak-git-server.pl @@ -99,7 +99,15 @@ while (my $client = $server->accept()) { warn "<<< $line\n"; my ($user,$hostname,$pwd,$command,$rel_path,$message) = split(/\s+/,$line,6); - my $on_host = $1 if $rel_path =~ s/^([^:]+):(.+)$/$2/ && -e $1; + my $on_host = ''; + if ( $rel_path =~ s/^([^:]+):(.+)$/$2/ ) { + if ( -e $1 ) { + $on_host = $1; + } else { + print $client "host $1 doesn't exist in backup\n"; + next; + } + } my $path = $rel_path =~ m{^/} ? $rel_path : "$pwd/$rel_path"; warn "$hostname [$command] $on_host:$path | $message\n"; -- 2.20.1