index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | archinstall/lib/user_interaction.py | 36 |
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py index f2eae530..fcdeace1 100644 --- a/archinstall/lib/user_interaction.py +++ b/archinstall/lib/user_interaction.py @@ -189,27 +189,21 @@ def ask_to_configure_network(): fg='red' ) - if not len(gateway := input('Enter your gateway (router) IP address or leave blank for none: ').strip()): - gateway = None - - # Assuming that gateway (router) IP address doesn't contain subnet, - # we can implement this check for it - # Implemented new check for correct IP input - - #gateway = input('Enter your gateway (router) IP address or leave blank for none: ').strip() - #while 1: - # try: - # if len(gateway) == 0: - # gateway = None - # else: - # ipaddress.ip_address(gateway) - # break - # except ValueError: - # log( - # "You need to enter a valid gateway (router) IP address.", - # level=LOG_LEVELS.Warning, - # fg='red' - # ) + gateway = input('Enter your gateway (router) IP address or leave blank for none: ').strip() + # Implemented new check for correct gateway IP address + while 1: + try: + if len(gateway) == 0: + gateway = None + else: + ipaddress.ip_address(gateway) + break + except ValueError: + log( + "You need to enter a valid gateway (router) IP address.", + level=LOG_LEVELS.Warning, + fg='red' + ) dns = None if len(dns_input := input('Enter your DNS servers (space separated, blank for none): ').strip()): |