mirror of
https://github.com/ryantm/agenix.git
synced 2024-11-22 09:40:47 +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" ]
|
if [ -f "$FILE" ]
|
||||||
then
|
then
|
||||||
DECRYPT=("${DEFAULT_DECRYPT[@]}")
|
DECRYPT=("${DEFAULT_DECRYPT[@]}")
|
||||||
if [ -f "$HOME/.ssh/id_rsa" ]; then
|
if [[ "${DECRYPT[*]}" != *"--identity"* ]]; then
|
||||||
DECRYPT+=(--identity "$HOME/.ssh/id_rsa")
|
if [ -f "$HOME/.ssh/id_rsa" ]; then
|
||||||
fi
|
DECRYPT+=(--identity "$HOME/.ssh/id_rsa")
|
||||||
if [ -f "$HOME/.ssh/id_ed25519" ]; then
|
fi
|
||||||
DECRYPT+=(--identity "$HOME/.ssh/id_ed25519")
|
if [ -f "$HOME/.ssh/id_ed25519" ]; then
|
||||||
|
DECRYPT+=(--identity "$HOME/.ssh/id_ed25519")
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ "${DECRYPT[*]}" != *"--identity"* ]]; then
|
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."
|
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