1 2 3 4 5 6 7 8 9
#!/bin/bash if [ "$2" == up ] && ! grep -qoP 'mirror=\K\S+' /proc/cmdline; then reflector \ --save /etc/pacman.d/mirrorlist \ --protocol https \ --latest 20 \ --sort rate fi