summaryrefslogtreecommitdiffstats
path: root/bin/ssh-add-helper
blob: 092d4510b0bb5c51b9ca2f516cff45a786261dec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env perl
use strict;
use warnings;
use IO::Pty::Easy;

my $hostname = `hostname`;
my $pass = `pwsafe -pE ssh.$hostname`;
my $pty = IO::Pty::Easy->new;
$pty->spawn("ssh-add -t 1800 $ARGV[0]");
$pty->read;
$pty->write($pass . "\n");
while (1) {
    last if $pty->read =~ 'Identity added';
}