From 412f7d6cf4f4ef84b08ec72883e1f2f1dece94e4 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Tue, 5 Dec 2023 00:08:55 +0100 Subject: [PATCH] Use find to properly use glob in condition --- doc/man/arch-update.1 | 1 + src/script/arch-update.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/man/arch-update.1 b/doc/man/arch-update.1 index a613283..9ad9d61 100755 --- a/doc/man/arch-update.1 +++ b/doc/man/arch-update.1 @@ -137,6 +137,7 @@ sudo sed -i "s/packages=$(checkupdates)/packages=$(checkupdates | awk '{print $1 .BR sed (1), .BR file (1), .BR grep (1), +.BR find (1), .BR mkdir (1), .BR mv (1), .BR curl (1), diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index 8e2bad1..ece529f 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -372,7 +372,7 @@ pacnew_files() { # Definition of the kernel_reboot function: Verify if there's a kernel update waiting for a reboot to be applied kernel_reboot() { - if [ -f /boot/vmlinuz* ]; then + if find /boot/vmlinuz* &> /dev/null; then kernel_compare=$(file /boot/vmlinuz* | sed 's/^.*version\ //' | awk '{print $1}' | grep "$(uname -r)") else kernel_compare=$(file /usr/lib/modules/*/vmlinuz* | sed 's/^.*version\ //' | awk '{print $1}' | grep "$(uname -r)")