Skip to content

Commit

Permalink
Fix broken auto removals for Mga releases greater than 9
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry Jackson committed Sep 24, 2024
1 parent 385c517 commit 731175f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions remove-old-kernels
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# The script keeps NBK most recent kernels
# (c) Pierre Jarillon - 2018-04-03 - 2021-11-27
# (c) Jean-Baptiste Biernacki 2021
# (c) Barry C Jackson 2022-2023
# (c) Barry C Jackson 2022-2024
####################################
#
######################### Functions #########################
Expand Down Expand Up @@ -300,7 +300,7 @@ OCCDISK1=$(df -B 1M -l --output=used / | tail -n1 | awk '{ print $1 }')

#========================= Analyse /boot/ =============================

NK=$(find /boot -name "vmlinuz*.mga[0-9]" | wc -l)
NK=$(find /boot -name "vmlinuz*.mga[0-9][0-9]" | wc -l)

# In automatic mode exit immediately if kernels in boot <= number allowed to be removed
[[ "$MODE" = "A" ]] && (( NK < NBK )) && exit 0
Expand Down Expand Up @@ -547,7 +547,7 @@ if (( nbt != 0 )) ; then
fi
fi
done
NK=$(find /boot -name "vmlinuz*.mga[0-9]" | wc -l)
NK=$(find /boot -name "vmlinuz*.mga[0-9][0-9]" | wc -l)
OCCDISK2=$(df -B 1M -l --output=used / | tail -n1 | awk '{ print $1 }')
echo -e "${HdBgCol} $(i18n "Gain"):$((OCCDISK1 - OCCDISK2)) MB - $(i18n "Kernels in") /boot/: ${NK} ${Normal}"
fi
Expand Down

0 comments on commit 731175f

Please sign in to comment.