dotfiles

My collection of dotfiles
git clone git://git.noxz.tech/dotfiles
Log | Files | Refs

commit bbb65c39bfb56f7a2c416ee8d184bf275993fc3b
parent a01e44c79c15643ef4fafce526c312a5b5e09ff7
Author: Chris Noxz <chris@noxz.tech>
Date:   Thu, 21 May 2020 10:10:26 +0200

[bin] update ssh-add-pass to new version of expect

Diffstat:
Mbin/.local/bin/ssh-add-pass | 21+++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/bin/.local/bin/ssh-add-pass b/bin/.local/bin/ssh-add-pass @@ -5,11 +5,16 @@ if [ $# -ne 1 ] ; then exit 1 fi -_KEYFILE="$1" -_PASS="$(cat - | sed -e "s|\"|\\\"|g")" - -expect -c " \ - spawn ssh-add $_KEYFILE; \ - expect -re \".*passphrase.*\"; \ - send -- \"$_PASS\r\"; \ - expect eof" +PASS="$(cat - | sed -e "s|\"|\\\"|g")" + + +expect <<EOF +spawn ssh-add "$1" +expect { + -re ".*passphrase.*: $" { + send -- "$PASS\r" + exp_continue + } + eof +} +EOF