#!/bin/bash
# Runs in the Calamares show phase (background, no chroot yet).
# Refreshes apt package lists on the live system while the user fills in the
# installer wizard so that system-upgrade in the exec phase is faster.

# Bail silently if there is no network rather than erroring the installer.
if ! ping -c 1 -W 3 deb.debian.org >/dev/null 2>&1; then
    echo "update-check: no network connectivity, skipping apt update"
    exit 0
fi

echo "update-check: refreshing package lists..."
apt-get update -q
echo "update-check: done"
