From 7f716e819b8d6dd16a61dca01f4caa8202833046 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 8 Feb 2019 00:21:42 +0100 Subject: [PATCH] Kernel sorting Fixed an issue with kernels not sorting from oldest to newest correctly once the numeric value went past 9. --- pvekclean.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvekclean.sh b/pvekclean.sh index acb034d..220889b 100644 --- a/pvekclean.sh +++ b/pvekclean.sh @@ -40,7 +40,7 @@ current_kernel=$(uname -r) program_name="pvekclean" # Version -version="1.1" +version="1.2" # Check if force removal argument is added if [ "$1" == "-f" ] || [ "$1" == "--force" ]; then @@ -248,7 +248,7 @@ function uninstall_program(){ # PVE Kernel Clean main function function pve_kernel_clean { # Find all the PVE kernels on the system - kernels=$(dpkg --list| grep 'pve-kernel-.*-pve' | awk '{print $2}') + kernels=$(dpkg --list| grep 'pve-kernel-.*-pve' | awk '{print $2}' | sort -V) # List of kernels that will be removed (adds them as the script goes on) kernels_to_remove="" # Check the /boot used