add password check to init.sh

This commit is contained in:
Arthur Lu 2024-01-19 08:30:14 +00:00
parent 981388784b
commit 677f52b135

View File

@ -10,6 +10,11 @@ read -p "Admin User Email: " ADMIN_EMAIL
read -p "Admin User CN: " ADMIN_CN
read -p "Admin User SN: " ADMIN_SN
read -s -p "Admin Password: " ADMIN_PASSWD
echo ""
read -s -p "Confirm Password: " CONFIRM_PASSWD
echo ""
if [ "$ADMIN_PASSWD" = "$CONFIRM_PASSWD" ]; then
envsubst '$BASE_DN' < auth.template.ldif > auth.ldif
envsubst '$BASE_DN' < pass.template.ldif > pass.ldif
@ -25,3 +30,9 @@ unset ADMIN_CN
unset ADMIN_SN
unset ADMIN_PASSWD
rm auth.ldif init.ldif pass.ldif
else
echo "Error: Passwords do not match."
fi