projects
/
bak-git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
da9db40
)
report non-existing hosts:
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Fri, 19 Mar 2010 13:05:27 +0000
(14:05 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Fri, 19 Mar 2010 13:05:27 +0000
(14:05 +0100)
bak-git-server.pl
patch
|
blob
|
history
diff --git
a/bak-git-server.pl
b/bak-git-server.pl
index
f25e926
..
8ac6e3a
100755
(executable)
--- 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);
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";
my $path = $rel_path =~ m{^/} ? $rel_path : "$pwd/$rel_path";
warn "$hostname [$command] $on_host:$path | $message\n";