Update add-linux-pass.sh
This commit is contained in:
@@ -3,27 +3,16 @@
|
|||||||
if [ -d /opt/idssys/defaults ]; then
|
if [ -d /opt/idssys/defaults ]; then
|
||||||
source /opt/idssys/defaults/colors.inc
|
source /opt/idssys/defaults/colors.inc
|
||||||
source /opt/idssys/defaults/default.inc
|
source /opt/idssys/defaults/default.inc
|
||||||
|
[ -d /opt/idssys/nodemgmt ] && source /opt/idssys/nodemgmt/defaults.inc
|
||||||
else
|
else
|
||||||
source /dev/stdin <<< "$(curl -sL http://go.scity.us/colorsinc)"
|
source /dev/stdin <<< "$(curl -sL http://go.scity.us/colorsinc)"
|
||||||
source /dev/stdin <<< "$(curl -sL http://go.scity.us/defaultinc)"
|
source /dev/stdin <<< "$(curl -sL http://go.scity.us/defaultinc)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d /opt/idssys/nodemgmt ]; then
|
if [ "${NM_GITUSER}" != "" ] && [ "${NM_GITPASS}" != "" ]; then
|
||||||
source /opt/idssys/nodemgmt/defaults.inc
|
gituser=${NM_GITUSER}
|
||||||
fi
|
gitpass=${NM_GITPASS}
|
||||||
|
else
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo -e "${idsCL[LightGreen]}Adding Linux Pass Sync${idsCL[Default]}"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
apt -y install pass git curl gpg
|
|
||||||
|
|
||||||
git clone https://git.schroedercity.com/voltron/ids-linux-pass.git ~/.password-store
|
|
||||||
chmod -R 600 /root/.password-store
|
|
||||||
git config --global credential.helper store
|
|
||||||
|
|
||||||
if [ "${NM_GITUSER}" == "" ] || [ "${NM_GITPASS}" == "" ]; then
|
|
||||||
echo -e "${idsCL[LightCyan]}You'll need to authorize yourself${idsCL[Default]}\n"
|
echo -e "${idsCL[LightCyan]}You'll need to authorize yourself${idsCL[Default]}\n"
|
||||||
until [ "${gituser}" != "" ]; do
|
until [ "${gituser}" != "" ]; do
|
||||||
echo -en "${idsCL[LightCyan]}Username: ${idsCL[Default]}"
|
echo -en "${idsCL[LightCyan]}Username: ${idsCL[Default]}"
|
||||||
@@ -35,14 +24,27 @@ if [ "${NM_GITUSER}" == "" ] || [ "${NM_GITPASS}" == "" ]; then
|
|||||||
read gitpass
|
read gitpass
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
else
|
fi
|
||||||
gituser=${NM_GITUSER}
|
if [ "$(curl -u "${gituser}:${gitpass}" -sL https://git.schroedercity.com/voltron/private/raw/branch/master/secret.gpg)" == "Verify" ]; then
|
||||||
gitpass=${NM_GITPASS}
|
echo -e "${idsCL[LightRed]}Authorization Failed${idsCL[Default]}\n"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo -e "${idsCL[LightGreen]}Adding Linux Pass Sync${idsCL[Default]}"
|
||||||
|
echo ""
|
||||||
|
|
||||||
curl -u "${gituser}:${gitpass}" -L -o /tmp/secret.gpg https://git.schroedercity.com/voltron/private/raw/branch/master/secret.gpg
|
apt -y install pass git curl gpg
|
||||||
curl -u "${gituser}:${gitpass}" -L -o /tmp/idsvc.key https://git.schroedercity.com/voltron/private/raw/branch/master/idsvc.key
|
|
||||||
|
git clone https://git.schroedercity.com/voltron/ids-linux-pass.git ~/.password-store
|
||||||
|
chmod -R 600 /root/.password-store
|
||||||
|
git config --global credential.helper store
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
curl -u "${gituser}:${gitpass}" -sL -o /tmp/secret.gpg https://git.schroedercity.com/voltron/private/raw/branch/master/secret.gpg
|
||||||
|
curl -u "${gituser}:${gitpass}" -sL -o /tmp/idsvc.key https://git.schroedercity.com/voltron/private/raw/branch/master/idsvc.key
|
||||||
gpg --import /tmp/secret.gpg
|
gpg --import /tmp/secret.gpg
|
||||||
gpg --import /tmp/idsvc.key
|
gpg --import /tmp/idsvc.key
|
||||||
rm -f /tmp/secret.gpg /tmp/idsvc.key
|
rm -f /tmp/secret.gpg /tmp/idsvc.key
|
||||||
|
|||||||
Reference in New Issue
Block a user