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 @@
1
+# Archlinux Stale Kernel Check
2
+
3
+This small script compares the running kernel version (`uname -r`) and the
4
+kernel version on the filesystem (`file /boot/vmlinuz-linux`). If the versions
5
+differ, it prints "Reboot required.". If not, it prints "No reboot required."
6
+

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

@@ -0,0 +1,14 @@
1
+#!/bin/bash
2
+
3
+set -euo pipefail
4
+IFS=$'\n\t'
5
+
6
+RUNNING_VERSION=$(uname -r)
7
+FS_VERSION=$(file /boot/vmlinuz-linux | sed -rn 's/.* version ([0-9\.A-Z-]+) .*/\1/p')
8
+
9
+if [ ! "${RUNNING_VERSION}" = ${FS_VERSION} ]; then
10
+    echo "Reboot required."
11
+else
12
+    echo "No reboot required."
13
+fi
14
+

Loading…
Cancel
Save