From 1af786a9e1c08d586335c0c988cc9161b93ad96a Mon Sep 17 00:00:00 2001 From: f Date: Tue, 28 Sep 2021 12:52:02 -0300 Subject: [PATCH] No dejar ssh-agents flotando --- haini.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/haini.sh b/haini.sh index e9b566b..9ff2c0e 100755 --- a/haini.sh +++ b/haini.sh @@ -8,6 +8,7 @@ uname -m | grep -q x86_64 || exit 1 DIR="$(dirname "$(realpath "$0")")" ROOT="$(dirname "$DIR")" SELF="$(basename "$0")" +SSH_ADHOC=false # Sólo se puede correr desde el directorio de Sutty if test "$ROOT" != "$(dirname "$PWD")" && test "$ROOT" != "$PWD"; then @@ -234,6 +235,8 @@ if test "$HAIN_ENV"; then ${*:-$DEFAULT} else if test -z "${SSH_AUTH_SOCK}"; then + SSH_ADHOC=true + echo "Iniciando un ssh-agent temporal, te recomendamos instalarlo en tu terminal." >&2 eval "$(ssh-agent)" ssh-add @@ -241,4 +244,6 @@ else crear_entorno stdin=/dev/stdin correr "${*:-$DEFAULT}" + + ${SSH_ADHOC} && ssh-agent -k fi