index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton.feeds+github@gmail.com> | 2020-08-31 20:46:38 +0200 |
---|---|---|
committer | Anton Hvornum <anton.feeds+github@gmail.com> | 2020-08-31 20:46:38 +0200 |
commit | 35fc1773453de327afcda14ec79c7dc6be20a811 (patch) | |
tree | afd3fda19cfee7bfab0f6da7e2ec458424a1222b | |
parent | bb0ece0ecea21885599fc96b8706f33ab5bf0b74 (diff) |
-rw-r--r-- | examples/guided.py | 18 |
diff --git a/examples/guided.py b/examples/guided.py index 23785e7d..a600bc6b 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -27,9 +27,17 @@ while (root_pw := getpass.getpass(prompt='Enter root password (leave blank to le break users = {} +new_user_text = 'Any additional users to install (leave blank for no users): ' +if len(root_pw.strip()) == 0: + new_user_text = 'Create a super-user with sudo privileges: ' + while 1: - new_user = input('Any additional users to install (leave blank for no users): ') - if not len(new_user.strip()): break + new_user = input(new_user_text) + if len(new_user.strip()) == 0: + if len(root_pw.strip()) == 0: + archinstall.log(' * Since root is disabled, you need to create a least one user!', bg='black', fg='red') + continue + break new_user_passwd = getpass.getpass(prompt=f'Password for user {new_user}: ') new_user_passwd_verify = getpass.getpass(prompt=f'Enter password again for verification: ') if new_user_passwd != new_user_passwd_verify: @@ -72,7 +80,11 @@ def perform_installation(device, boot_partition): installation.install_profile(profile) for user, password in users.items(): - installation.user_create(user, password) + sudo = False + if len(root_pw.strip()) == 0: + sudo = True + + installation.user_create(user, password, sudo=sudo) if root_pw: installation.user_set_pw('root', root_pw) |