From 0227d4d3beee7c000d77c0c7c8aa1823f2372e4a Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Wed, 13 Dec 2023 18:38:13 -0800 Subject: Add new scripts These were being used on duvel. --- mga-userpasswd | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 mga-userpasswd (limited to 'mga-userpasswd') diff --git a/mga-userpasswd b/mga-userpasswd new file mode 100755 index 0000000..2e49c43 --- /dev/null +++ b/mga-userpasswd @@ -0,0 +1,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}" -- cgit v1.2.1