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