scripts/moduser

19 lines
397 B
Python
Executable file

#!/usr/bin/python3
import sys
from subprocess import run
# Modify an existing user
def moduser(username):
if username == 'Manager':
bind_user = 'cn=Manager,dc=exozy,dc=me'
else:
bind_user = 'uid=' + username + ',ou=People,dc=exozy,dc=me'
# Modify user
run(['ldapvi', '--user', bind_user])
# Running as script
if __name__ == "__main__":
moduser(sys.argv[1])