Genre.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`

sexe=`ldapsearch -h $IPLDAP -x  -b uid=$1,ou=People,$BASEDN  -D cn=admin,$BASEDN -w $LDAPPASS|grep gecos|cut -d"," -f3`

echo $sexe

Sortie

 
./genre.sh lanr
M
./genre.sh abbac
F