- if ( $command eq 'install' ) {
- print $client '#!/bin/sh',$/,'echo `pwd` $* | nc 10.60.0.92 9001',$/;
+while (my $client = $server->accept()) {
+ my ($hostname,$pwd,$command,$path,$message) = split(/\s+/,<$client>,5);
+
+ if ( $pwd eq 'install' ) {
+ warn "install on $hostname\n";
+ print $client $shell_client;
+ close($client);
+ system 'ssh-copy-id', "root\@$hostname" if ! -d $hostname;