Skip to content
Snippets Groups Projects
Verified Commit aff592a1 authored by David Beniamine's avatar David Beniamine
Browse files

Fix bad test + use separate ldiff files for groups

parent c4fecab7
Branches
No related tags found
No related merge requests found
......@@ -43,12 +43,18 @@ fi
. /etc/slis/slis.conf
# set -x
# Check for LDAP group Primtux
if [ -z "ldapsearch -x cn=Primtux | grep numEntries" ]
for f in dist/*.ldiff
do
echo $f
group=`head -n 1 $f | sed 's/^[^ ]* \([^,]*\),.*$/\1/'`
if [ -z "`ldapsearch -x $group | grep numEntries`" ]
then
echo "adding group"
# insert primtux group
sed -e "s/BASE/$LDAP_BASE_DN/" $DIST/primtux.ldiff > $TEMPF.ldiff
sed -e "s/BASE/$LDAP_BASE_DN/" $f > $TEMPF.ldiff
ldapadd -x -D "cn=$LDAP_ADMIN_RDN,$LDAP_BASE_DN" -w $LDAP_ADMIN_PW -f $TEMPF.ldiff
fi
done
ldapsearch -x -LLL uid=$user > $TEMPF.ldiff
if [ ! -s $TEMPF.ldiff ]
then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment