From 67e7e7953b3efc238c757d6169057ac8cb4a3e9d Mon Sep 17 00:00:00 2001 From: mrjk Date: Wed, 20 Mar 2024 01:55:47 -0400 Subject: [PATCH] change: default ssh tmout and shell id autorestore --- lib/idmgr_mod_ssh.sh | 2 +- shell/bash.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/idmgr_mod_ssh.sh b/lib/idmgr_mod_ssh.sh index 43851c2..b9a576e 100644 --- a/lib/idmgr_mod_ssh.sh +++ b/lib/idmgr_mod_ssh.sh @@ -326,7 +326,7 @@ background() { idm_ssh__agent_start() { # local socket=$1 local id=$1 - local life=5d + local life=4w local socket_dir="${XDG_RUNTIME_DIR}/ssh-agent/${id}" local socket="${socket_dir}/socket" diff --git a/shell/bash.sh b/shell/bash.sh index d0a0d8e..f16ea25 100644 --- a/shell/bash.sh +++ b/shell/bash.sh @@ -51,6 +51,13 @@ i_restore_last_id () [[ "$IDM_LAST_ID_AUTOLOAD" == 'true' ]] || return 0 + # Restore from SHELL_ID + if [[ -n "${SHELL_ID:-}" ]]; then + i enable $SHELL_ID + return + fi + + # Restore from last loaded shell local IDM_DIR_CACHE=${IDM_DIR_CACHE:-${XDG_CACHE_HOME:-~/.cache}/idmgr} local state_file=$IDM_DIR_CACHE/last_id if [ -f "$state_file" ]; then