From 048166e84372757f9fa1c775fe483d4ac2926e1b Mon Sep 17 00:00:00 2001 From: David Adam Date: Tue, 20 Feb 2018 21:06:36 +0800 Subject: [PATCH] Extend fish examples to match other shells --- keychain.1 | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/keychain.1 b/keychain.1 index 711546e..eab2945 100644 --- a/keychain.1 +++ b/keychain.1 @@ -375,11 +375,11 @@ key: \& eval \`keychain \-\-eval id_rsa id_dsa 0123ABCD\` .Ve .PP -For the fish shell, use the following format: +For the fish shell, the following snippet can be added to your configuration file: .PP .Vb 3 \& if status \-\-is\-interactive -\& keychain \-\-eval \-\-quiet \-Q id_rsa | source +\& keychain \-\-eval \-\-quiet \-Q id_rsa id_dsa 0123ABCD | source \& end .Ve .PP @@ -415,6 +415,19 @@ This is equivalent for C shell (including tcsh): \& endif .Ve .PP +Likewise, the following commands can be used in fish: +.PP +.Vb 8 +\& keychain id_rsa id_dsa 0123ABCD +\& test \-z "$hostname"; and set hostname (uname \-n) +\& if test \-f "$HOME/.keychain/$hostname\-fish" +\& source $HOME/.keychain/$hostname\-fish +\& end +\& if test \-f "$HOME/.keychain/$hostname\-fish\-gpg" +\& source $HOME/.keychain/$hostname\-fish\-gpg +\& end +.Ve +.PP To load keychain variables from a script (for example from cron) and abort unless id_dsa is available: .PP