Redbrick User management tool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
339 B

  1. #! /usr/bin/env python3
  2. import sys
  3. from ..useradm.rbuserdb import RBUserDB
  4. udb = RBUserDB()
  5. udb.connect()
  6. fd, n = udb.uidNumber_getnext()
  7. for line in sys.stdin:
  8. if line == 'uidNumber: -1\n':
  9. print('uidNumber:', n)
  10. n += 1
  11. else:
  12. print(line, end=' ')
  13. udb.uidNumber_savenext(fd, n)
  14. udb.uidNumber_unlock(fd)