summaryrefslogtreecommitdiffstats
path: root/mga-userpasswd
blob: 2e49c43afd8059acb1475879138301000fa38d95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

cLDAP_URL="ldaps://ldap.mageia.org"
cLDAP_BASE_DN="ou=People,dc=mageia,dc=org"

if [ "x$USER" == "xroot" ]
then
	echo "Please what's your LDAP uid ?"
	read -a vUID
else
	vUID=$USER
fi

if [ "x$1" == "x" ]
then
	echo "Please give the uid you want to edit ?"
	read -a vEDIT_UID
else
	vEDIT_UID=$1
fi
echo "First you'll be asked to provide the new password, then youl'll be asked YOUR LDAP password..."
echo ""
sleep 2
/usr/bin/ldappasswd -x -H ${cLDAP_URL} -D "uid=${vUID},${cLDAP_BASE_DN}" -W -S "uid=${vEDIT_UID},${cLDAP_BASE_DN}"