From 469cb15622660120921aaaf04de4cc0914d65784 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 23 Nov 2023 20:48:12 -0600 Subject: [PATCH] Update add-linux-pass.sh --- add-linux-pass.sh | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/add-linux-pass.sh b/add-linux-pass.sh index 3412660..1ddcb9b 100755 --- a/add-linux-pass.sh +++ b/add-linux-pass.sh @@ -8,6 +8,10 @@ else source /dev/stdin <<< "$(curl -sL http://go.scity.us/defaultinc)" fi +if [ -d /opt/idssys/nodemgmt ]; then + source /opt/idssys/nodemgmt/defaults.inc +fi + echo "" echo -e "${idsCL[LightGreen]}Adding Linux Pass Sync${idsCL[Default]}" @@ -19,18 +23,22 @@ git clone https://git.schroedercity.com/voltron/ids-linux-pass.git ~/.password-s chmod -R 600 /root/.password-store git config --global credential.helper store - -echo -e "${idsCL[LightCyan]}You'll need to authorize yourself${idsCL[Default]}\n" -until [ "${gituser}" != "" ]; do - echo -en "${idsCL[LightCyan]}Username: ${idsCL[Default]}" - read gituser - echo -done -until [ "${gitpass}" != "" ]; do - echo -en "${idsCL[LightCyan]}Password: ${idsCL[Default]}" - read gitpass - echo -done +if [ "${NM_GITUSER}" == "" ] || [ "${NM_GITPASS}" == "" ]; then + echo -e "${idsCL[LightCyan]}You'll need to authorize yourself${idsCL[Default]}\n" + until [ "${gituser}" != "" ]; do + echo -en "${idsCL[LightCyan]}Username: ${idsCL[Default]}" + read gituser + echo + done + until [ "${gitpass}" != "" ]; do + echo -en "${idsCL[LightCyan]}Password: ${idsCL[Default]}" + read gitpass + echo + done +else + gituser=${NM_GITUSER} + gitpass=${NM_GITPASS} +fi curl -u "${gituser}:${gitpass}" -L -o /tmp/secret.gpg https://git.schroedercity.com/voltron/private/raw/branch/master/secret.gpg