Uid2eleonet.sh

De OpenWikiBSD
Aller à : navigation, rechercher

Script

#!/usr/local/bin/bash
# Récupération des paramètres depuis le fichier eponyme
FICPARAMS=/usr/script/params.txt
IPLDAP=`cat $FICPARAMS |grep IPLDAP|cut -d":" -f2`
BASEDN=`cat $FICPARAMS |grep BASEDN|cut -d":" -f2-99`
LDAPPASS=`cat $FICPARAMS |grep LDAPPASS|cut -d":" -f2`
ADMINLDAP=`cat $FICPARAMS |grep ADMINLDAP|cut -d":" -f2`
SQLUSER=`cat $FICPARAMS |grep SQLUSER |cut -d":" -f2`
SQLPASS=`cat $FICPARAMS |grep SQLPASS|cut -d":" -f2`
BDD=`cat $FICPARAMS |grep BDD|cut -d":" -f2`

#eleonet=`ldapsearch -h $ -x  -b uid=$1,ou=People,$basedn  -D cn=admin,$basedn -w $pass|grep employeeNumber|cut -d" " -f2`
eleonet=`ldapsearch -h $IPLDAP -x  -b uid=$1,ou=People,$BASEDN  -D cn=admin,$BASEDN -w $LDAPPASS|grep employeeNumber|cut -d" " -f2`

#echo "eleonet de $1 : $eleonet"
echo $eleonet

Sortie

./uid2eleonet.sh lanr
08046