From 1996a500fe8709b8580ecaab305888c1376cc0aa Mon Sep 17 00:00:00 2001 From: Astound Date: Sat, 3 Aug 2024 23:24:59 +0800 Subject: Relax ssh-agent, add support days to sagent_start, like `sagent_start 1d` --- hyperterm/tools/ssh-agent.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'hyperterm/tools/ssh-agent.sh') diff --git a/hyperterm/tools/ssh-agent.sh b/hyperterm/tools/ssh-agent.sh index 4c24ba5..e121722 100644 --- a/hyperterm/tools/ssh-agent.sh +++ b/hyperterm/tools/ssh-agent.sh @@ -14,7 +14,11 @@ function sshagent_start { chmod 600 "${SSH_ENV}" # shellcheck source=/dev/null source "${SSH_ENV}" > /dev/null - ssh-add -t 5d + + # Set the default time to 5 days if not provided + local days="${1:-5d}" + + ssh-add -t "$days" printf '\e[1;36m%s\e[m\n' "succeeded" } -- cgit v1.2.3