Change comments to include some dashes for better readability
This commit is contained in:
18
arch_update
18
arch_update
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
BACKUP_LIMIT=3
|
BACKUP_LIMIT=3
|
||||||
|
|
||||||
# Check dependencies
|
# ---------------- Check dependencies ----------------
|
||||||
echo -e '\nInstalling dependencies ...' >&2
|
echo -e '\nInstalling dependencies ...' >&2
|
||||||
if ! which yay >/dev/null 2>&1; then
|
if ! which yay >/dev/null 2>&1; then
|
||||||
git clone https://aur.archlinux.org/yay.git
|
git clone https://aur.archlinux.org/yay.git
|
||||||
@@ -15,12 +15,12 @@ fi
|
|||||||
yay -S --needed --noconfirm curl git neovim pacman-contrib yaycache
|
yay -S --needed --noconfirm curl git neovim pacman-contrib yaycache
|
||||||
[ ! -e /usr/local/bin/vim ] && sudo ln -s /usr/bin/nvim /usr/local/bin/vim
|
[ ! -e /usr/local/bin/vim ] && sudo ln -s /usr/bin/nvim /usr/local/bin/vim
|
||||||
|
|
||||||
# Display updates beforehand
|
# ---------------- Display updates beforehand ----------------
|
||||||
echo -e '\nChecking for updates ...' >&2
|
echo -e '\nChecking for updates ...' >&2
|
||||||
checkupdates
|
checkupdates
|
||||||
yay -Qua
|
yay -Qua
|
||||||
|
|
||||||
# Ask to proceed
|
# ---------------- Ask to proceed ----------------
|
||||||
while true; do
|
while true; do
|
||||||
echo -e '\nDo you want to start the update? Y/n' >&2
|
echo -e '\nDo you want to start the update? Y/n' >&2
|
||||||
read -r answer || exit 1
|
read -r answer || exit 1
|
||||||
@@ -38,7 +38,7 @@ while true; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# Backup system
|
# ---------------- Backup system ----------------
|
||||||
if which btrfs >/dev/null 2>&1; then
|
if which btrfs >/dev/null 2>&1; then
|
||||||
yay -S --needed --noconfirm snapper
|
yay -S --needed --noconfirm snapper
|
||||||
[ ! -f /etc/snapper/configs/root ] && sudo snapper -c root create-config /
|
[ ! -f /etc/snapper/configs/root ] && sudo snapper -c root create-config /
|
||||||
@@ -48,25 +48,25 @@ if which btrfs >/dev/null 2>&1; then
|
|||||||
sudo snapper -c root create -c number
|
sudo snapper -c root create -c number
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Update mirrors
|
# ---------------- Update mirrors ----------------
|
||||||
echo -e '\nUpdating mirrors ...' >&2
|
echo -e '\nUpdating mirrors ...' >&2
|
||||||
curl -s 'https://archlinux.org/mirrorlist/?country=DE&protocol=https&use_mirror_status=on' | sed -e 's/^#\(Server\)/\1/' -e '/^#/d' | rankmirrors - | sudo tee /etc/pacman.d/mirrorlist
|
curl -s 'https://archlinux.org/mirrorlist/?country=DE&protocol=https&use_mirror_status=on' | sed -e 's/^#\(Server\)/\1/' -e '/^#/d' | rankmirrors - | sudo tee /etc/pacman.d/mirrorlist
|
||||||
|
|
||||||
# Update system
|
# ---------------- Update system ----------------
|
||||||
echo -e '\nUpdating system ...' >&2
|
echo -e '\nUpdating system ...' >&2
|
||||||
yay -Syu --noconfirm
|
yay -Syu --noconfirm
|
||||||
|
|
||||||
# Remove orphans
|
# ---------------- Remove orphans ----------------
|
||||||
echo -e '\nRemoving orphans ...' >&2
|
echo -e '\nRemoving orphans ...' >&2
|
||||||
orphans=$(yay -Qtdq)
|
orphans=$(yay -Qtdq)
|
||||||
[ ! "X$orphans" = 'X' ] && yay -Rns --noconfirm $orphans
|
[ ! "X$orphans" = 'X' ] && yay -Rns --noconfirm $orphans
|
||||||
|
|
||||||
# Clean cache
|
# ---------------- Clean cache ----------------
|
||||||
echo -e '\nCleaning cache ...' >&2
|
echo -e '\nCleaning cache ...' >&2
|
||||||
sudo paccache -r
|
sudo paccache -r
|
||||||
yaycache -r
|
yaycache -r
|
||||||
|
|
||||||
# Update flatpaks
|
# ---------------- Update flatpaks ----------------
|
||||||
if which flatpak >/dev/null 2>&1; then
|
if which flatpak >/dev/null 2>&1; then
|
||||||
echo -e '\nUpdating flatpaks ...' >&2
|
echo -e '\nUpdating flatpaks ...' >&2
|
||||||
flatpak update
|
flatpak update
|
||||||
|
|||||||
Reference in New Issue
Block a user