From 412655d436e21dad218e4e93ff889c7e07fff93a Mon Sep 17 00:00:00 2001 From: "xiongdian.me" Date: Tue, 15 Nov 2022 11:40:53 +0800 Subject: [PATCH] piv logi fix --- .zshrc2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.zshrc2 b/.zshrc2 index 5ad32e4..9df6365 100644 --- a/.zshrc2 +++ b/.zshrc2 @@ -96,15 +96,17 @@ case $(bash "$DOTFILES/tools/common.sh" get_os_type) in esac piv-agent() { + eval $(ssh-agent -k) # they are: ubuntu, macos, respectively local SO_PATHS=( "/usr/lib64/opensc-pkcs11.so" "/usr/local/lib/opensc-pkcs11.so" ) for i in ${SO_PATHS[*]}; do if [[ -f "$i" ]]; then + echo "using: $i" eval $(ssh-agent -P "$i") ssh-add -s "$i" echo "now available keys:" ssh-add -l - break + return 0 fi done echo "opensc-pkcs11.so not found"