Skip to content

Instantly share code, notes, and snippets.

@Taurolyon
Last active July 3, 2022 06:54
Show Gist options
  • Save Taurolyon/0b1dad9895f82e438acba5f3770a5ad7 to your computer and use it in GitHub Desktop.
Save Taurolyon/0b1dad9895f82e438acba5f3770a5ad7 to your computer and use it in GitHub Desktop.
WIP
#!/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