example startup script
[bak-git.git] / bak-git-server.pl
index f591fc6..5b91ddc 100755 (executable)
@@ -28,6 +28,8 @@ bak command overview:
 
   bak - push all changed files to server
 
+See L<http://blog.rot13.org/bak-git> for more information
+
 =cut
 
 use warnings;
@@ -51,7 +53,7 @@ $server_ip ||= '127.0.0.1';
 
 my $shell_client = <<__SHELL_CLIENT__;
 #!/bin/sh
-echo \$USER/\$SUDO_USER `hostname -s` `pwd` \$* | nc $server_ip 9001
+echo \$USER/\$SUDO_USER `hostname` `pwd` \$* | nc $server_ip 9001
 __SHELL_CLIENT__
 
 chdir $dir;
@@ -103,6 +105,7 @@ while (my $client = $server->accept()) {
        chomp($line);
        warn "<<< $line\n";
        my ($user,$hostname,$pwd,$command,$rel_path,$message) = split(/\s+/,$line,6);
+       $hostname =~ s/\..+$//;
 
        my $on_host = '';
        if ( $rel_path =~ s/^([^:]+):(.+)$/$2/ ) {