From 2759c259e11c144149759ec832dae2a68cc72a19 Mon Sep 17 00:00:00 2001 From: Stefan Benz Date: Thu, 5 Mar 2020 17:15:41 +0100 Subject: [PATCH] fix(files): possibility for multiple secrets --- scripts/initialize_gopass.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/initialize_gopass.sh b/scripts/initialize_gopass.sh index 87b0da4..03f4e2d 100755 --- a/scripts/initialize_gopass.sh +++ b/scripts/initialize_gopass.sh @@ -2,8 +2,8 @@ #example: initialize_gopass.sh git@github.com:/ REPOSITORY_LIST_JSON=$1 -GPGFILE=$2 -SSHFILE=$3 +GPGFOLDER=$2 +SSHFOLDER=$3 LOGFILE=gopass.log GOPASS_VERSION="1.8.6" @@ -15,14 +15,14 @@ set -e function initialize_ssh { #initialize ssh to checkout secret store mkdir -p $HOME/.ssh -cp $SSHFILE $HOME/.ssh/id_rsa +cp $SSHFOLDER/* $HOME/.ssh chmod 700 $HOME/.ssh -chmod 600 $HOME/.ssh/id_rsa +chmod 600 $HOME/.ssh/* } function import_and_trust_gpg-key { # import gpg keys to keystore -gpg --import ${GPGFILE} &>> $LOGFILE +for gpgfile in $(ls ${GPGFOLDER}); do gpg --import ${GPGFOLDER}/${gpgfile} &>> $LOGFILE; done # trust imported keys for fpr in $(gpg --list-keys --with-colons | awk -F: '/fpr:/ {print $10}' | sort -u &>> $LOGFILE); do echo -e "5\ny\n" | gpg --command-fd 0 --expert --edit-key $fpr trust &>> $LOGFILE ; done }