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.

15 lines
316 B

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