Revert gateway to None if the string is zero-len.

This commit is contained in:
Anton Hvornum 2020-11-11 20:25:01 +00:00
parent 065da563fb
commit 092f2d3240
1 changed files with 2 additions and 1 deletions

View File

@ -204,7 +204,8 @@ if nic:
fg='red'
)
if gateway = input('Enter your gateway (router) IP address or leave blank for none: ').strip()
if not len(gateway := input('Enter your gateway (router) IP address or leave blank for none: ').strip()):
gateway = None
dns = None
if len(dns := input('Enter your DNS servers (space separated, blank for none): ').strip()):