App-sibs

 view release on metacpan or  search on metacpan

bin/sibs  view on Meta::CPAN

  print $SSH "\n__DATA__\n";
  print $SSH $self->$stdin;
  close $SSH;    # TODO: do i need to wait?
}

sub ssh_file {
  my ($self, $file) = @_;

  if (!$self->{ssh_dir}) {
    mkdir "$ENV{HOME}/.ssh" or die "Could not mkdir $ENV{HOME}/.ssh: $!" unless -d "$ENV{HOME}/.ssh";
    chmod 0700, "$ENV{HOME}/.ssh";
    $self->{ssh_dir} = "$ENV{HOME}/.ssh";
  }

  return $self->{ssh_dir} unless $file;
  return join '/', $self->{ssh_dir}, $file;
}

sub _backup_name {
  POSIX::strftime($_[0]->{format} || '%d-%H', localtime);
}

t/create-identity-file.t  view on Meta::CPAN

  remove_tree 't/home/.ssh' if -d 't/home/.ssh';
}

{
  $main::SSH_KEYGEN = 't/bin/ssh-keygen';
  open my $SSH_KEYGEN, '>', $main::SSH_KEYGEN or die $!;
  print $SSH_KEYGEN "#!$^X\n";
  print $SSH_KEYGEN "open my \$FH, '>', pop(\@ARGV) .'.pub';\n";
  print $SSH_KEYGEN "print \$FH join ',', \@ARGV;\n";
  print $SSH_KEYGEN "print \$FH qq(\\n);";
  chmod 0755, $main::SSH_KEYGEN;
}

{
  $main::SSH = 't/bin/ssh';
  open my $SSH, '>', $main::SSH or die $!;
  print $SSH "#!$^X\n";
  print $SSH "open my \$FH, '>', 't/bin/ssh.out';\n";
  print $SSH "print \$FH \$_ while <STDIN>;\n";
  print $SSH "print \$FH join ',', \@ARGV;\n";
  print $SSH "print \$FH qq(\\n);";
  chmod 0755, $main::SSH;
}

{
  $script->{destination} = URI->new('rsync://bruce@localhost');
  $script->create_identity_file;
  open my $FH, '<', 't/home/.ssh/sibs_dsa.pub';
  is readline($FH), "-q,-b,4096,-t,rsa,-N,,-f\n", 'ran ssk-keygen';
}

{



( run in 0.238 second using v1.01-cache-2.11-cpan-496ff517765 )