Last active
July 3, 2022 06:54
-
-
Save Taurolyon/0b1dad9895f82e438acba5f3770a5ad7 to your computer and use it in GitHub Desktop.
WIP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pac-init () { | |
pacman-key --init | |
pacman-key --populate archlinux | |
pacman-key --refresh-keys | |
mirrorlist-update | |
} | |
mirrorlist-update () { | |
mv -v /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.orig | |
curl -o /etc/pacman.d/mirrorlist 'https://archlinux.org/mirrorlist/?country=US&protocol=https&ip_version=4' | |
sed -i "s/#Server/Server/g" /etc/pacman.d/mirrorlist | |
update-system | |
} | |
update-system () { | |
pacman -Syy archlinux-keyring --noconfirm | |
pacman -Su --noconfirm | |
} | |
# Check if online | |
if ping -q -c 1 -W 1 google.com >/dev/null; then | |
pac-init | |
else | |
echo "The network is down" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment