index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-05-16 14:02:49 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-16 14:02:49 +0000 |
commit | 9f14f2cc53c041051837815ff00907a1ae28c415 (patch) | |
tree | 0552659497437e3c814e6f26995b065c37ce5096 | |
parent | 736d9f338dd259f02b92456e564d87b4a98cb838 (diff) | |
parent | 22fc18dc46cd605495175fc141029882b036ab4a (diff) |
-rw-r--r-- | archinstall/lib/networking.py | 8 | ||||
-rw-r--r-- | examples/guided.py | 5 |
diff --git a/archinstall/lib/networking.py b/archinstall/lib/networking.py index b0c4b569..8a2f0edd 100644 --- a/archinstall/lib/networking.py +++ b/archinstall/lib/networking.py @@ -26,6 +26,14 @@ def list_interfaces(skip_loopback=True): return interfaces +def check_mirror_reachable(): + try: + check = SysCommand("pacman -Sy") + return check.exit_code == 0 + except: + return False + + def enrich_iface_types(interfaces: dict): result = {} for iface in interfaces: diff --git a/examples/guided.py b/examples/guided.py index 177f4adb..cce06b29 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -4,6 +4,7 @@ import time import archinstall from archinstall.lib.hardware import has_uefi +from archinstall.lib.networking import check_mirror_reachable if archinstall.arguments.get('help'): print("See `man archinstall` for help.") @@ -387,5 +388,9 @@ def perform_installation(mountpoint): archinstall.log(f"Disk states after installing: {archinstall.disk_layouts()}", level=logging.DEBUG) +if not check_mirror_reachable(): + archinstall.log("Arch Linux mirrors are not reachable. Please check your internet connection and try again.", level=logging.INFO, fg="red") + exit(1) + ask_user_questions() perform_installation_steps() |