mirror of
https://github.com/Kron4ek/Conty
synced 2024-11-16 19:50:06 +01:00
Regenerate mirrorlist with reflector
If reflector is not avaiable on the host system, let's regenerate the mirrorlist by using reflector from the chroot.
This commit is contained in:
parent
72b7dd36d2
commit
22abd340b8
1 changed files with 9 additions and 1 deletions
|
@ -252,7 +252,9 @@ mount_chroot
|
|||
generate_localegen
|
||||
|
||||
if command -v reflector 1>/dev/null; then
|
||||
reflector --protocol https --score 5 --sort rate --save mirrorlist
|
||||
echo "Generating mirrorlist..."
|
||||
reflector --connection-timeout 10 --download-timeout 10 --protocol https --score 7 --sort rate --save mirrorlist
|
||||
reflector_used=1
|
||||
else
|
||||
generate_mirrorlist
|
||||
fi
|
||||
|
@ -299,6 +301,12 @@ date -u +"%d-%m-%Y %H:%M (DMY UTC)" > "${bootstrap}"/version
|
|||
# These packages are required for the self-update feature to work properly
|
||||
run_in_chroot pacman --noconfirm --needed -S base reflector squashfs-tools fakeroot
|
||||
|
||||
# Regenerate the mirrorlist with reflector if reflector was not used before
|
||||
if [ -z "${reflector_used}" ]; then
|
||||
echo "Generating mirrorlist..."
|
||||
run_in_chroot reflector --connection-timeout 10 --download-timeout 10 --protocol https --score 7 --sort rate --save /etc/pacman.d/mirrorlist
|
||||
fi
|
||||
|
||||
export -f install_packages
|
||||
run_in_chroot bash -c install_packages
|
||||
|
||||
|
|
Loading…
Reference in a new issue