This commit is contained in:
Jaroslaw Konik 2026-05-12 12:20:34 +02:00
parent 94d60bb3da
commit e43cb44964

19
update Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -euo pipefail
if [[ $EUID -ne 0 ]]; then
echo "Requesting sudo..."
exec sudo "$0" "$@"
fi
pacman -Syu
installed=$(pacman -Q linux | awk '{print $2}' | sed 's/\.arch/-arch/')
running=$(uname -r)
if [[ "$running" == "$installed" ]]; then
echo "updated, no reboot needed"
else
echo "updated, rebooting"
reboot
fi