group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
if test "x$group_exists" = "x"; then
bbwarn "groupadd command did not succeed. Retrying..."
- sleep 1
else
break
fi
if test $count = $retries; then
bbfatal "Tried running groupadd command $retries times without scucess, giving up"
fi
+ sleep $count
done
else
bbwarn "group $groupname already exists, not re-creating it"
user_exists="`grep "^$username:" $rootdir/etc/passwd || true`"
if test "x$user_exists" = "x"; then
bbwarn "useradd command did not succeed. Retrying..."
- sleep 1
else
break
fi
if test $count = $retries; then
bbfatal "Tried running useradd command $retries times without scucess, giving up"
fi
+ sleep $count
done
else
bbwarn "user $username already exists, not re-creating it"
mem_exists="`grep "^$groupname:[^:]*:[^:]*:\([^,]*,\)*$username\(,[^,]*\)*" $rootdir/etc/group || true`"
if test "x$mem_exists" = "x"; then
bbwarn "groupmems command did not succeed. Retrying..."
- sleep 1
else
break
fi
fi
bbfatal "Tried running groupmems command $retries times without scucess, giving up"
fi
+ sleep $count
done
else
bbwarn "group $groupname already contains $username, not re-adding it"
group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
if test "x$group_exists" != "x"; then
bbwarn "groupdel command did not succeed. Retrying..."
- sleep 1
else
break
fi
if test $count = $retries; then
bbfatal "Tried running groupdel command $retries times without scucess, giving up"
fi
+ sleep $count
done
else
bbwarn "group $groupname doesn't exist, not removing it"
user_exists="`grep "^$username:" $rootdir/etc/passwd || true`"
if test "x$user_exists" != "x"; then
bbwarn "userdel command did not succeed. Retrying..."
- sleep 1
else
break
fi
if test $count = $retries; then
bbfatal "Tried running userdel command $retries times without scucess, giving up"
fi
+ sleep $count
done
else
bbwarn "user $username doesn't exist, not removing it"
eval $PSEUDO groupmod $opts
if test $? != 0; then
bbwarn "groupmod command did not succeed. Retrying..."
- sleep 1
else
break
fi
if test $count = $retries; then
bbfatal "Tried running groupmod command $retries times without scucess, giving up"
fi
+ sleep $count
done
else
bbwarn "group $groupname doesn't exist, unable to modify it"
eval $PSEUDO usermod $opts
if test $? != 0; then
bbwarn "usermod command did not succeed. Retrying..."
- sleep 1
else
break
fi
if test $count = $retries; then
bbfatal "Tried running usermod command $retries times without scucess, giving up"
fi
+ sleep $count
done
else
bbwarn "user $username doesn't exist, unable to modify it"