Update
This commit is contained in:
parent
94d60bb3da
commit
e43cb44964
1 changed files with 19 additions and 0 deletions
19
update
Executable file
19
update
Executable 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
|
||||
Loading…
Reference in a new issue