use grep instead of sed for SP version

This commit is contained in:
Max Ka 2020-02-14 18:47:52 +01:00
parent 6a1d0e9cb4
commit 71d793efdb

View file

@ -1610,7 +1610,7 @@ __check_end_of_life_versions() {
# < 11 SP4
# < 12 SP2
# < 15 SP1
SUSE_PATCHLEVEL=$(awk -F'=' '/VERSION_ID/ { print $2 }' /etc/os-release | sed 's/[[:digit:]]\+\.//g' )
SUSE_PATCHLEVEL=$(awk -F'=' '/VERSION_ID/ { print $2 }' /etc/os-release | grep -oP "\.\K\w+")
if [ "${SUSE_PATCHLEVEL}" = "" ]; then
SUSE_PATCHLEVEL="00"
fi