remove-old-kernels: Always say something about backup kernel
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
This commit is contained in:
parent
185d99fade
commit
6091d09c2a
@ -127,15 +127,24 @@ good_kernel=${good_kernel##* }
|
|||||||
good_kernel_days=${good_kernel_days#(}
|
good_kernel_days=${good_kernel_days#(}
|
||||||
good_kernel_days=${good_kernel_days%%+*}
|
good_kernel_days=${good_kernel_days%%+*}
|
||||||
good_kernel_package=
|
good_kernel_package=
|
||||||
if [ -n "$good_kernel" ] && [ "$good_kernel" != "$uname_r" ]; then
|
if [ -n "$good_kernel" ]; then
|
||||||
|
if [ "$good_kernel" != "$uname_r" ]; then
|
||||||
tver=${good_kernel%%-*}
|
tver=${good_kernel%%-*}
|
||||||
trel=${good_kernel##*-}
|
trel=${good_kernel##*-}
|
||||||
tflv=${good_kernel#"$tver"-}
|
tflv=${good_kernel#"$tver"-}
|
||||||
tflv=${tflv%-"$trel"}
|
tflv=${tflv%-"$trel"}
|
||||||
good_kernel=kernel-image-$tflv-$tver-$trel
|
good_kernel=kernel-image-$tflv-$tver-$trel
|
||||||
good_kernel_package=$(rpm -q "$good_kernel")
|
good_kernel_package=$(rpm -q "$good_kernel" 2>/dev/null)
|
||||||
unset tver trel tflv
|
unset tver trel tflv
|
||||||
echo "Previous kernel with uptime $good_kernel_days days: $good_kernel"
|
echo "Previous kernel with uptime $good_kernel_days days: $BRIGHT$good_kernel$NORM (backup)"
|
||||||
|
if [ -z "$good_kernel_package" ]; then
|
||||||
|
echo "${RED}Warning: Package for the backup kernel not found.$NORM"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Backup kernel is the same as booted kernel (uptime $good_kernel_days days)."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "${RED}Warning: Backup kernel is not determined.$NORM"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Sort the kernels
|
# Sort the kernels
|
||||||
|
Loading…
x
Reference in New Issue
Block a user