master
Carlo Capocasa 7 years ago
parent e786eb4059
commit 3c9d7e45fc

@ -25,26 +25,21 @@ else
# Get the SSH_AUTH_SOCK variable from the user session # Get the SSH_AUTH_SOCK variable from the user session
export $(systemctl --user show-environment | grep ^SSH_AUTH_SOCK=) export $(systemctl --user show-environment | grep ^SSH_AUTH_SOCK=)
# Use self as askpass to work around ssh-add not reading stdin
# on some systems
# Ensure the ssh-agent service is started # Ensure the ssh-agent service is started
systemctl --user start ssh-agent systemctl --user start ssh-agent
# specify self to ask for password # Use self as askpass to work around ssh-add not reading stdin
# on some systems
export SSH_ASKPASS="$0" export SSH_ASKPASS="$0"
#Fake display to coax to actually use SSH_ASKPASS #Fake display to coax to actually use SSH_ASKPASS
export DISPLAY=nodisplay export DISPLAY=nodisplay
cat | ssh-add ssh-add
exit 0 exit 0
# Double as SSH_ASKPASS # Double as SSH_ASKPASS
else else
# Fetch home dir
export $(systemctl --user show-environment | grep ^HOME=)
# Decrypt passhrase if file exists # Decrypt passhrase if file exists
FILE="$HOME/.ssh/passphrase" FILE="$HOME/.ssh/passphrase"
if [ -e "$FILE" ]; then if [ -e "$FILE" ]; then

Loading…
Cancel
Save