dotfiles

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

ssh-add-pass (239B)


      1 #!/bin/sh
      2 
      3 if [ $# -ne 1 ] ; then
      4 	echo "Usage: ssh-add-pass keyfile"
      5 	exit 1
      6 fi
      7 
      8 PASS="$(cat - | sed -e "s|\"|\\\"|g")"
      9 
     10 expect <<EOF
     11 spawn ssh-add "$1"
     12 expect {
     13 	-re ".*passphrase.*: $" {
     14 		send -- "$PASS\r"
     15 		exp_continue
     16 	}
     17 	eof
     18 }
     19 EOF