summaryrefslogtreecommitdiffstats
path: root/scripts/fish/functions/__ssh_agent_is_key_added.fish
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/fish/functions/__ssh_agent_is_key_added.fish')
-rw-r--r--scripts/fish/functions/__ssh_agent_is_key_added.fish9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/fish/functions/__ssh_agent_is_key_added.fish b/scripts/fish/functions/__ssh_agent_is_key_added.fish
new file mode 100644
index 0000000..63951fe
--- /dev/null
+++ b/scripts/fish/functions/__ssh_agent_is_key_added.fish
@@ -0,0 +1,9 @@
+# custom
+function __ssh_agent_is_key_added -d "checks if fingerprint is already present"
+ set SSH_FP (ssh-keygen -lf ~/.ssh/id_lysergic-cert.pub | awk '{print $2}')
+ if ! test -z "$SSH_FP"
+ and ssh-add -l | grep -q "$SSH_FP"
+ else
+ return 1
+ end
+end