refactor: better function names

ADP-216_sops_automation
LeeW 10 months ago
parent 501f08afd9
commit f192204f00

@ -64,7 +64,7 @@ fi
# /VALIDATE INPUTS
# /OPTIONS: ARGPARSING and VALIDATION
function fn_extract_fpr(){
function fn_gpg_extract_fpr(){
gpgkeyfile=$1;shift;
# fingerprint
# caveat: restrict to netgo.de email, use-case:
@ -75,7 +75,7 @@ function fn_extract_fpr(){
echo "${fpr}"
}
function fn_extract_uid(){
function fn_gpg_extract_uid(){
gpgkeyfile=$1;shift;
# user id
# caveat: restrict to netgo.de email, use-case:
@ -96,13 +96,13 @@ function fn_generate_sops_config(){
type_list=()
for gpgkeyfile in *automation*gpg.pub; do
type_list+=( "autom" )
fpr_list+=( "$(fn_extract_fpr "${gpgkeyfile}")" )
uid_list+=( "$(fn_extract_uid "${gpgkeyfile}")" )
fpr_list+=( "$(fn_gpg_extract_fpr "${gpgkeyfile}")" )
uid_list+=( "$(fn_gpg_extract_uid "${gpgkeyfile}")" )
done
for gpgkeyfile in $(ls *gpg.pub | grep -v automation); do
type_list+=( "human" )
fpr_list+=( "$(fn_extract_fpr "${gpgkeyfile}")" )
uid_list+=( "$(fn_extract_uid "${gpgkeyfile}")" )
fpr_list+=( "$(fn_gpg_extract_fpr "${gpgkeyfile}")" )
uid_list+=( "$(fn_gpg_extract_uid "${gpgkeyfile}")" )
done

Loading…
Cancel
Save