Ask for custom UID in adduser

This commit is contained in:
Anthony Wang 2021-10-06 19:05:05 -05:00
parent 7698a9a6a4
commit 6fa480fc18

View file

@ -8,7 +8,13 @@ username = input('Enter username: ')
firstname = input('Enter first name: ')
lastname = input('Enter last name: ')
email = input('Enter email: ')
uid = 1001 + len([file for file in os.listdir('.') if file.endswith('.ldif')])
# Get UID
custom_uid = input('Would you like to enter a custom UID? (y/N) ')
if custom_uid == 'y' or custom_uid == 'Y':
uid = input('Enter UID: ')
else:
uid = 1001 + len([file for file in os.listdir('.') if file.endswith('.ldif')])
# Password
password = os.popen('tr -dc A-Za-z0-9 </dev/urandom | head -c 16; echo ""').read()[:-1]