From 78150e236f9812374ffc6ec2382985306a42c644 Mon Sep 17 00:00:00 2001 From: Siphonight Date: Mon, 18 Aug 2025 17:49:48 +0200 Subject: [PATCH] Ajout de suppression des agents SSH sur fermeture du terminal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit L'agent ssh se fermera désormais automatiquement lorsqu'un signal EXIT sera détecté par la commande trap. --- bw_cli_autolog.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bw_cli_autolog.sh b/bw_cli_autolog.sh index b00cd1e..1822bf6 100644 --- a/bw_cli_autolog.sh +++ b/bw_cli_autolog.sh @@ -5,7 +5,7 @@ identities_create() { Inception_Detect=0 if [ -z "${BW_Session}" ] || [ "$(echo "${BW_Session}" | wc -c)" -lt 10 ]; then - Local_Version="2.0.2" + Local_Version="2.1.2" Latest_Version=$(curl -s "https://gitea.cloudyfy.fr/Siphonight/bw-cli_autologger/src/branch/main/bw_cli_autolog.sh" | grep -m1 "Local_Version" | cut -d ';' -f 2 | cut -d '&' -f 1) if [ "${Local_Version}" != "${Latest_Version}" ]; then tput setaf 1 @@ -47,7 +47,6 @@ identities_create() { tput sgr0 eval "$(ssh-agent)" - #trap 'kill $SSH_AGENT_PID' EXIT # shellcheck disable=SC3037 printf "%s" "${BW_List}" | jq -r '.[] | select(.name=="identities - configs") | .notes' >"${HOME}"/.identities-loaded.sh @@ -83,4 +82,6 @@ identities_create if [ -n "${BW_Session}" ]; then trap identities_destroy EXIT +else + trap "kill $SSH_AGENT_PID && echo test" EXIT fi