From 280e7235bcf4cbd584c7861289321b67f39fb817 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 8 Jan 2018 20:07:13 +0100 Subject: check-kernel.in: generic kernel detection added --- check-kernel.in | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/check-kernel.in b/check-kernel.in index b3088d7..4b9f421 100644 --- a/check-kernel.in +++ b/check-kernel.in @@ -46,6 +46,7 @@ while true; do shift done +unset installed if which pacman >/dev/null 2>&1; then # arch linux running=$( @@ -74,6 +75,23 @@ elif which apt >/dev/null 2>&1; then tail -n1 ) else + running=$( + uname -r + ) + installed=$( + ls /boot | \ + sed -n ' + s/^vmlinuz-\([0-9.]\+\)$/\1/ + T + p + ' | \ + sort -V | \ + tail -n1 + ) +fi + +if [ -z "${installed}" ] || \ + [ "$(echo "${installed}" | wc -l)" -ne 1 ]; then >&2 printf 'Cannot determin installed kernel.\n' exit 2 fi -- cgit v1.2.3-70-g09d2