12 system 'git init' unless -e '.git';
14 my $server = IO::Socket::INET->new(
21 while (my $client = $server->accept()) {
22 my ($command,$path,$message) = split(/\s+/,<$client>,3);
23 my $ip = $client->peerhost;
25 warn "$ip [$command] $path | $message\n";
28 system 'ssh-copy-id', "root\@$ip";
35 mkpath "$ip/$dir" unless -e "$ip/$dir";
37 if ( $command eq 'add' ) {
38 warn 'rsync', "root\@$ip:$path", "$ip/$path";
39 system 'rsync', "root\@$ip:$path", "$ip/$path";
40 system 'git', 'add', "$ip/$path";
42 system 'rsync', "root\@$ip:$path", "$ip/$path";
45 $message ||= "$command $ip $path";
46 system 'git', 'commit', '-m', $message, "$ip/$path";