Skip to content

Commit

Permalink
call with variables
Browse files Browse the repository at this point in the history
  • Loading branch information
joergi committed Jan 5, 2025
1 parent fb9fc6f commit 28c90ee
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions superexport.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ create_secretreader_sh_file(){
echo "end create_secretreader_sh_file"
}

secretreader=""

mac_reading_passwords_out_of_secrets(){
echo "start mac_reading_passwords_out_of_secrets"
secretreader="export $secretname \$(vault kv get -field=$2 \"$3\")"
Expand All @@ -178,14 +180,13 @@ linux_reading_passwords_out_of_secrets(){

create_secretreader_sh_file


####################################
# reading passwords out of secrets #
####################################
if [[ "$(uname)" == 'Darwin' ]]; then
mac_reading_passwords_out_of_secrets
mac_reading_passwords_out_of_secrets $secretreader $secretname $2 $3
elif [[ "$(uname)" == 'Linux' ]]; then
linux_reading_passwords_out_of_secrets
linux_reading_passwords_out_of_secrets $secretreader $1 $secretname
fi

####################################
Expand Down

0 comments on commit 28c90ee

Please sign in to comment.