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

Make script reentrant

parent 751a1772
No related branches found
No related tags found
No related merge requests found
...@@ -33,8 +33,15 @@ fi ...@@ -33,8 +33,15 @@ fi
while read first last level gender categorie while read first last level gender categorie
do do
echo "Creating user for $first $last" echo "Creating user for $first $last"
uid=`ldapsearch -x cn="$first $last" | grep "^uid:" | cut -d ' ' -f 2`
if [ -z "$uid" ]
then
$scriptbinpath/userAdd.pl $first $last "xxx" "" $gender $categorie $scriptbinpath/userAdd.pl $first $last "xxx" "" $gender $categorie
else
echo "Not recreating user $uid"
fi
uid=`ldapsearch -x cn="$first $last" | grep "^uid:" | cut -d ' ' -f 2` uid=`ldapsearch -x cn="$first $last" | grep "^uid:" | cut -d ' ' -f 2`
echo "found uid '$uid'"
if [ -z "$uid" ] if [ -z "$uid" ]
then then
KO="$KO $uid" KO="$KO $uid"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment