Ask for custom UID in adduser
This commit is contained in:
parent
7698a9a6a4
commit
6fa480fc18
8
adduser
8
adduser
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue