Browse Source

First commit

master
Chimo 2 years ago
commit
48cd718e65
No known key found for this signature in database
2 changed files with 20 additions and 0 deletions
  1. 6
    0
      README.md
  2. 14
    0
      is-reboot-required.sh

+ 6
- 0
README.md View File

@@ -0,0 +1,6 @@
# Archlinux Stale Kernel Check

This small script compares the running kernel version (`uname -r`) and the
kernel version on the filesystem (`file /boot/vmlinuz-linux`). If the versions
differ, it prints "Reboot required.". If not, it prints "No reboot required."


+ 14
- 0
is-reboot-required.sh View File

@@ -0,0 +1,14 @@
#!/bin/bash

set -euo pipefail
IFS=$'\n\t'

RUNNING_VERSION=$(uname -r)
FS_VERSION=$(file /boot/vmlinuz-linux | sed -rn 's/.* version ([0-9\.A-Z-]+) .*/\1/p')

if [ ! "${RUNNING_VERSION}" = ${FS_VERSION} ]; then
echo "Reboot required."
else
echo "No reboot required."
fi


Loading…
Cancel
Save