mirror of
https://github.com/ryantm/agenix.git
synced 2024-12-22 15:48:30 +03:00
fix: if an identity is specified, don't use the default ones
fixes #151
This commit is contained in:
parent
e4f0dcc8d3
commit
ec396f7a76
1 changed files with 7 additions and 5 deletions
|
@ -107,11 +107,13 @@ function edit {
|
|||
if [ -f "$FILE" ]
|
||||
then
|
||||
DECRYPT=("${DEFAULT_DECRYPT[@]}")
|
||||
if [ -f "$HOME/.ssh/id_rsa" ]; then
|
||||
DECRYPT+=(--identity "$HOME/.ssh/id_rsa")
|
||||
fi
|
||||
if [ -f "$HOME/.ssh/id_ed25519" ]; then
|
||||
DECRYPT+=(--identity "$HOME/.ssh/id_ed25519")
|
||||
if [[ "${DECRYPT[*]}" != *"--identity"* ]]; then
|
||||
if [ -f "$HOME/.ssh/id_rsa" ]; then
|
||||
DECRYPT+=(--identity "$HOME/.ssh/id_rsa")
|
||||
fi
|
||||
if [ -f "$HOME/.ssh/id_ed25519" ]; then
|
||||
DECRYPT+=(--identity "$HOME/.ssh/id_ed25519")
|
||||
fi
|
||||
fi
|
||||
if [[ "${DECRYPT[*]}" != *"--identity"* ]]; then
|
||||
echo "No identity found to decrypt $FILE. Try adding an SSH key at $HOME/.ssh/id_rsa or $HOME/.ssh/id_ed25519 or using the --identity flag to specify a file."
|
||||
|
|
Loading…
Reference in a new issue