ssh-copy-id on install
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 18 Feb 2010 10:40:18 +0000 (11:40 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 18 Feb 2010 10:40:18 +0000 (11:40 +0100)
server.pl

index a61e3db..e363df4 100755 (executable)
--- a/server.pl
+++ b/server.pl
@@ -59,6 +59,7 @@ while (my $client = $server->accept()) {
                warn "install on $ip\n";
                print $client $shell_client;
                close($client);
+               system 'ssh-copy-id', "root\@$ip" if ! -d $ip;
                next;
        }
 
@@ -67,10 +68,6 @@ while (my $client = $server->accept()) {
 
        warn "$ip [$command] $path | $message\n";
 
-       if ( ! -d $ip ) {
-               system 'ssh-copy-id', "root\@$ip";
-       }
-
 
        my $dir = $path;
        $dir =~ s{/[^/]+$}{};