Skip to content

Commit

Permalink
Use find to properly use glob in condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Antiz96 committed Dec 4, 2023
1 parent 5078d9c commit 412f7d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/man/arch-update.1
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion src/script/arch-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)")
Expand Down

0 comments on commit 412f7d6

Please sign in to comment.