Fix: mod_pass binary requirement and ssh key search improvment
This commit is contained in:
parent
ea34261619
commit
ab46eae784
@ -6,6 +6,14 @@ IDM_MOD_DEPS="id gpg"
|
||||
## Pass functions
|
||||
##########################################
|
||||
|
||||
idm_pass_header ()
|
||||
{
|
||||
local id=$1
|
||||
|
||||
lib_require_bin pass || idm_exit 1
|
||||
}
|
||||
|
||||
|
||||
idm_pass ()
|
||||
{
|
||||
#set -x
|
||||
@ -21,6 +29,7 @@ idm_pass ()
|
||||
fi
|
||||
|
||||
# Interncal override case
|
||||
idm_pass_header $id
|
||||
|
||||
# Fallback to command
|
||||
lib_id_is_enabled $id
|
||||
@ -32,6 +41,7 @@ idm_pass__ls ()
|
||||
{
|
||||
local id=${1}
|
||||
lib_id_is_enabled $id || return 0
|
||||
idm_pass_header $id
|
||||
|
||||
{
|
||||
PASSWORD_STORE_DIR=~/.config/pass/${id} \
|
||||
|
||||
@ -226,12 +226,22 @@ idm_ssh_add ()
|
||||
lib_id_is_enabled $id
|
||||
|
||||
|
||||
if [[ ! -z $key ]]; then
|
||||
pub_keys=$(find ~/.ssh/id -maxdepth $maxdepth -name "${id}_*" -name '*pub' -name "*$1*" | sort)
|
||||
if [[ ! -z "$key" ]]; then
|
||||
pub_keys=$(
|
||||
{
|
||||
# Compat mode
|
||||
find ~/.ssh/id -maxdepth $maxdepth -name "${id}_*" -name '*pub' -name "*$1*" | sort
|
||||
|
||||
# New mode (test)
|
||||
find ~/.ssh/$id -maxdepth $maxdepth -name "${id}_*" -name '*pub' -name "*$1*" | sort
|
||||
} | sort | uniq
|
||||
)
|
||||
else
|
||||
pub_keys=$(find ~/.ssh/id -maxdepth $maxdepth -name "${id}_*" -name '*pub' | sort)
|
||||
pub_keys=$(find ~/.ssh/$id -maxdepth $maxdepth -name "${id}_*" -name '*pub' | sort)
|
||||
fi
|
||||
|
||||
echo "$pub_keys"
|
||||
|
||||
# Get list of key
|
||||
local key_list=""
|
||||
while read -r pub_key; do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user