add admin email field

This commit is contained in:
Arthur Lu 2024-01-18 04:50:09 +00:00
parent b7731c1fc7
commit 174a2c7fa4
2 changed files with 4 additions and 1 deletions

View File

@ -1,17 +1,19 @@
export BASE_DN=''
export ADMIN_ID=''
export ADMIN_EMAIL=''
export ADMIN_CN=''
export ADMIN_SN=''
export ADMIN_PASSWD=''
read -p "Base DN: " BASE_DN
read -p "Admin User ID: " ADMIN_ID
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
envsubst '$BASE_DN' < auth.template.ldif > auth.ldif
envsubst '$BASE_DN' < pass.template.ldif > pass.ldif
envsubst '$BASE_DN:$ADMIN_ID:$ADMIN_CN:$ADMIN_SN:$ADMIN_PASSWD' < init.template.ldif > init.ldif
envsubst '$BASE_DN:$ADMIN_ID:$ADMIN_EMAIL:$ADMIN_CN:$ADMIN_SN:$ADMIN_PASSWD' < init.template.ldif > init.ldif
sudo ldapmodify -H ldapi:/// -Y EXTERNAL -f auth.ldif
sudo ldapmodify -H ldapi:/// -Y EXTERNAL -f pass.ldif

View File

@ -17,6 +17,7 @@ cn: admins
# paas user
dn: uid=$ADMIN_ID,ou=people,$BASE_DN
objectClass: inetOrgPerson
mail: $ADMIN_EMAIL
cn: $ADMIN_CN
sn: $ADMIN_SN
uid: $ADMIN_ID