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.

16 lines
359 B

  1. #! /usr/bin/python
  2. import re
  3. import sys
  4. re_dn = re.compile(r'^(dn: cn=.*?,).*(ou=.*?),o=DCU$')
  5. for i in sys.stdin:
  6. i = i.rstrip()
  7. if i.startswith("dn:"):
  8. print(re.sub(re_dn, r'\1\2,ou=dcu,o=redbrick', i))
  9. print("objectClass: top")
  10. print("objectClass: dcuAccount")
  11. elif not i.startswith('objectClass:'):
  12. print(i)