diff options
author | pico.dev <pico.dev@gmail.com> | 2020-05-30 16:21:36 +0200 |
---|---|---|
committer | pico.dev <pico.dev@gmail.com> | 2020-05-30 16:21:36 +0200 |
commit | febc21a4463b0c90864c14de152566d5720bf45f (patch) | |
tree | 2dcd23c7caa22c65feb313ca049bd52e4525cc29 | |
parent | 625dcf54d5e6334d426a9b2dc825c63e4c34e53c (diff) |
Add reflector support
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | alis.conf | 2 | ||||
-rw-r--r-- | alis.sh | 13 |
3 files changed, 15 insertions, 1 deletions
@@ -174,6 +174,7 @@ https://www.archlinux.org/download/ * https://wiki.archlinux.org/index.php/Pacman * https://wiki.archlinux.org/index.php/Arch_User_Repository * https://wiki.archlinux.org/index.php/Mirrors +* https://wiki.archlinux.org/index.php/Reflector * https://wiki.archlinux.org/index.php/VirtualBox * https://wiki.archlinux.org/index.php/Mkinitcpio * https://wiki.archlinux.org/index.php/Intel_graphics @@ -29,6 +29,8 @@ WIFI_HIDDEN="" PING_HOSTNAME="mirrors.kernel.org" # install (precede with ! for not install) +REFLECTOR="false" +REFLECTOR_COUNTRIES=("Spain") PACMAN_MIRROR="https://mirrors.kernel.org/archlinux/\$repo/os/\$arch" KERNELS="!linux-lts !linux-lts-headers !linux-hardened !linux-hardened-headers !linux-zen !linux-zen-headers" # Additional kernels and headers (multiple) KERNELS_COMPRESSION="!gzip !bzip2 !lzma !xz !lzop !lz4" @@ -134,6 +134,8 @@ function check_variables() { check_variables_list "KERNELS" "$KERNELS" "linux-lts linux-lts-headers linux-hardened linux-hardened-headers linux-zen linux-zen-headers" "false" check_variables_list "KERNELS_COMPRESSION" "$KERNELS_COMPRESSION" "gzip bzip2 lzma xz lzop lz4" "false" check_variables_value "TIMEZONE" "$TIMEZONE" + check_variables_boolean "REFLECTOR" "$REFLECTOR" + check_variables_value "PACMAN_MIRROR" "$PACMAN_MIRROR" check_variables_value "LOCALES" "$LOCALES" check_variables_value "LOCALE_CONF" "$LOCALE_CONF" check_variables_value "LANG" "$LANG" @@ -422,7 +424,7 @@ function partition() { # partition if [ "$FILE_SYSTEM_TYPE" == "f2fs" ]; then - pacman -Syu --noconfirm f2fs-tools + pacman -Sy --noconfirm f2fs-tools fi if [ "$PARTITION_MODE" == "auto" ]; then @@ -546,6 +548,15 @@ function install() { if [ -n "$PACMAN_MIRROR" ]; then echo "Server=$PACMAN_MIRROR" > /etc/pacman.d/mirrorlist fi + if [ "$REFLECTOR" == "true" ]; then + COUNTRIES=() + for COUNTRY in "${REFLECTOR_COUNTRIES[@]}"; do + COUNTRIES+=(--country "${COUNTRY}") + done + pacman -Sy --noconfirm reflector + reflector "${COUNTRIES[@]}" --latest 25 --age 24 --protocol https --completion-percent 100 --sort rate --save /etc/pacman.d/mirrorlist + fi + sed -i 's/#Color/Color/' /etc/pacman.conf sed -i 's/#TotalDownload/TotalDownload/' /etc/pacman.conf |