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

Fix create mass users

parent fc03f643
No related branches found
No related tags found
No related merge requests found
...@@ -20,12 +20,19 @@ then ...@@ -20,12 +20,19 @@ then
exit 1 exit 1
fi fi
rm -f users.txt
. /etc/slis/slis.conf
while read first last level while read first last level
do do
echo $first uid=`ldapsearch -x cn="$first $last" | grep "^uid:" | cut -d ' ' -f 2`
echo $last $DIR/create_primtux_user.sh $uid $level
echo $level # set initial password
uid=`ldapsearch -x cn="$first $last" | grep "^uid:" | cut -f ' ' -d 2` echo "dn: uid=$uid,ou=People,$LDAP_BASE_DN" > $$.ldiff
echo $uid echo "changetype: modify" >> $$.ldiff
echo $DIR/create_primtux_user.sh $uid $level echo "replace: userPassword" >> $$.ldiff
echo "userPassword: $uid" >> $$.ldiff
ldapmodify -x -D "cn=$LDAP_ADMIN_RDN,$LDAP_BASE_DN" -w $LDAP_ADMIN_PW -f $$.ldiff
rm $$.ldiff
echo -e "$uid\n$uid" | smbpasswd -s -U $uid
echo $uid >> users.txt
done < $1 done < $1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment