bak diff [host:][/path]
bak status [/path]
bak log [/path]
+ bak log-grep pattern
+ bak grep pattern
bak show
bak ch[anges]
bak cat [host:]/path
bak grep pattern
+ bak find filename-pattern
bak - push all changed files to server
$host = $1;
} elsif ( /^\s+(\S+)\s+(.+)/ ) {
$ssh_tunnel->{$host}++ if lc($1) eq 'remoteforward' && $2 =~ m/9001/;
+ } elsif ( /^\s+$/ ) {
+ # nop
} else {
- die "can't parse $_";
+ warn "can't parse [$_]";
}
}
while (my $client = $server->accept()) {
my $line = <$client>;
chomp($line);
- warn "<<< $line\n";
+
+ my $peerhost = $client->peerhost;
+ if ( $peerhost !~ m/^(10\.13\.37\.|10\.60\.0\.|10\.200\.100\.)/ ) {
+ print $client "$peerhost not allowed\n";
+ next;
+ }
+
+ warn "<<< $peerhost $line\n";
my ($user,$hostname,$pwd,$command,$rel_path,$message) = split(/\s+/,$line,6);
$hostname =~ s/\..+$//;
print $client `ls $file_path 2>&1`;
} elsif ( $command eq 'show' ) {
print $client `git show $rel_path`;
+ } elsif ( $command eq 'log-grep' ) {
+ #print $client `git log -g --grep=$rel_path`;
} elsif ( $command eq 'grep' ) {
- print $client `git log -g --grep=$rel_path`;
+ print $client `git grep $rel_path`;
+ } elsif ( $command eq 'find' ) {
+ print $client `find . -iname '*$rel_path*' | sed -e 's,^./,,' -e 's,/,:/,'`
} elsif ( $command eq 'link' ) {
if ( $on_host ) {
mkbasedir "$on_host/$path";