diff options
Diffstat (limited to 'bin/laptop/ssh-add-helper')
-rwxr-xr-x | bin/laptop/ssh-add-helper | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/laptop/ssh-add-helper b/bin/laptop/ssh-add-helper new file mode 100755 index 0000000..cae6f27 --- /dev/null +++ b/bin/laptop/ssh-add-helper @@ -0,0 +1,14 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use IO::Pty::Easy; + +my $hostname = `hostname`; +my $pass = `pass search 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'; +} |