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
Branches
No related tags found
No related merge requests found
......@@ -20,12 +20,19 @@ then
exit 1
fi
rm -f users.txt
. /etc/slis/slis.conf
while read first last level
do
echo $first
echo $last
echo $level
uid=`ldapsearch -x cn="$first $last" | grep "^uid:" | cut -f ' ' -d 2`
echo $uid
echo $DIR/create_primtux_user.sh $uid $level
uid=`ldapsearch -x cn="$first $last" | grep "^uid:" | cut -d ' ' -f 2`
$DIR/create_primtux_user.sh $uid $level
# set initial password
echo "dn: uid=$uid,ou=People,$LDAP_BASE_DN" > $$.ldiff
echo "changetype: modify" >> $$.ldiff
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment