From 7737e65a89d12c3002ce9fadf6228cf91f7e7655 Mon Sep 17 00:00:00 2001 From: xerus2000 <27jf@pm.me> Date: Tue, 15 Dec 2020 21:46:35 +0100 Subject: [PATCH] config/yadm/bootstrap: add reflector --- .config/yadm/bootstrap | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.config/yadm/bootstrap b/.config/yadm/bootstrap index fa7f0b0..05a40b4 100755 --- a/.config/yadm/bootstrap +++ b/.config/yadm/bootstrap @@ -45,9 +45,20 @@ fi ## Software section "Software" -highlight "Colorize Pacman & enable multilib" -test -f /etc/pacman.conf && sudo sed -i 's/#Color/Color/' /etc/pacman.conf && sudo sed -i "$(grep -n "\[multilib\]" /etc/pacman.conf | cut -d':' -f1),+1 s/# *//" /etc/pacman.conf - +highlight "Configure pacman" +if test -f /etc/pacman.conf; then + sudo sed -i 's/#Color/Color/' /etc/pacman.conf + sudo sed -i "$(grep -n "\[multilib\]" /etc/pacman.conf | cut -d':' -f1),+1 s/# *//" /etc/pacman.conf + highlight "Reflector" + echo "--save /etc/pacman.d/mirrorlist + --protocol https + --country Germany + --latest 20 + --sort rate" | sudo tee /etc/xdg/reflector/reflector.conf + sudo systemctl start reflector & + sudo systemctl enable reflector.timer +fi + highlight "Block internet at night & on weekdays in the morning to force focus" # https://askubuntu.com/a/124512 and https://blog.sleeplessbeastie.eu/2018/06/21/how-to-create-iptables-firewall-using-custom-chains/ sudo iptables --new-chain chain-times 2>/dev/null || sudo iptables --flush chain-times