namely, the current/latest and previous one, for which we also keep the
last kernel installed and synced.
the pipe to 'head' has the added bonus of guarding against 'grep'
returnin non-zero and triggering 'set -e'
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
latest_2_versions="$(echo "$sorted_list" | grep -E '^[^ ]+-pve' | head -n2 )"
- series_metapackages="$(echo "$sorted_list" | grep -Ev '^[^ ]+-pve')"
+ series_metapackages="$(echo "$sorted_list" | grep -Ev '^[^ ]+-pve' | head -n2)"
- oldseries="$(echo "$series_metapackages" | head -n2 | tail -n1)"
+ oldseries="$(echo "$series_metapackages" | tail -n1)"
oldseries_latest_kernel="$(echo "$sorted_list" | grep -E "^${oldseries}\.[^ ]+-pve" | head -n1 )"
if [ -e "$MANUAL_KERNEL_LIST" ]; then