summary refs log tree commit diff
path: root/update
blob: d3d35b54c8b8ce763bacc9294bd45f1c8eeeb934 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env zsh
set -exuo pipefail

# user
if [[ `whoami` == "root" ]]; then
	echo "Running as root, skipping user updates..."
else
	git --git-dir=$HOME/.dotfiles --work-tree=$HOME pull --rebase
	pass git pull
fi

# system
# update archlinux-keyring first, since occasionally a laptop will be unused for a few months
paru -S archlinux-keyring
paru -Syu

# TODO skip unless paru just updated the kernel (files in /lib/modules will be newer than in /boot/EFI/Linux)
# TODO keep only 2-3 latest images for -lts and -arch1
if [[ `cat /etc/hostname` == 'dziban' ]]; then
	for kernel in /lib/modules/*; do
		sudo dracut --verbose --force --uefi --kver "${kernel##*/}"
	done
fi