summary refs log tree commit diff
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2023-01-29 13:11:19 -0600
committerStarfall <us@starfall.systems>2023-01-29 13:15:39 -0600
commitc8022a3a249d80792a03c748064aac805e56f729 (patch)
tree21cb90c88427b92305559b7b54e83c0ed115b064
parent21b5e15f55c3894806a89324c832ca0b7e8c0797 (diff)
update: update system and user config
-rwxr-xr-xupdate22
1 files changed, 22 insertions, 0 deletions
diff --git a/update b/update
new file mode 100755
index 0000000..ab14e0b
--- /dev/null
+++ b/update
@@ -0,0 +1,22 @@
+#!/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
+# consider updating archlinux-keyring first, as infrequently issues arise from having very out of date keys
+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