Created
August 16, 2021 06:27
-
-
Save bombsimon/6fba30f81427f0b8f390173bf2355368 to your computer and use it in GitHub Desktop.
Check if reboot is required on Arch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
NEXTLINE=0 | |
FIND="" | |
for I in `file /boot/vmlinuz*`; do | |
if [ ${NEXTLINE} -eq 1 ]; then | |
FIND="${I}" | |
NEXTLINE=0 | |
else | |
if [ "${I}" = "version" ]; then NEXTLINE=1; fi | |
fi | |
done | |
if [ ! "${FIND}" = "" ]; then | |
CURRENT_KERNEL=`uname -r` | |
if [ ! "${CURRENT_KERNEL}" = "${FIND}" ]; then | |
echo "Boot required" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment