diff options
author | Astound <kirito@disroot.org> | 2024-08-03 23:24:59 +0800 |
---|---|---|
committer | Astound <kirito@disroot.org> | 2024-08-03 23:26:52 +0800 |
commit | 1996a500fe8709b8580ecaab305888c1376cc0aa (patch) | |
tree | 699c49c809e6232e8a2b48c00d9c98ff73c9f4e4 /hyperterm/tools/ssh-agent.sh | |
parent | 00c6040f1a8aad2b37627b4179ba517e5faba486 (diff) | |
download | hyperterm-1996a500fe8709b8580ecaab305888c1376cc0aa.tar.lz hyperterm-1996a500fe8709b8580ecaab305888c1376cc0aa.tar.xz hyperterm-1996a500fe8709b8580ecaab305888c1376cc0aa.zip |
Relax ssh-agent, add support days to sagent_start, like `sagent_start 1d`
Diffstat (limited to 'hyperterm/tools/ssh-agent.sh')
-rw-r--r-- | hyperterm/tools/ssh-agent.sh | 6 |
1 files changed, 5 insertions, 1 deletions
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" } |