Skip to content

Instantly share code, notes, and snippets.

@bombsimon
Created August 16, 2021 06:27
Show Gist options
  • Save bombsimon/6fba30f81427f0b8f390173bf2355368 to your computer and use it in GitHub Desktop.
Save bombsimon/6fba30f81427f0b8f390173bf2355368 to your computer and use it in GitHub Desktop.
Check if reboot is required on Arch
#!/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