check if . in new version, append .1 if not

This commit is contained in:
m0duspwnens
2021-04-05 16:44:51 -04:00
parent 83bf709290
commit 89f72bb6ed

View File

@@ -649,6 +649,12 @@ fi
echo "Checking if Salt was upgraded."
echo ""
# Check that Salt was upgraded
SALTVERSIONPOSTUPGRADE=$(salt --versions-report | grep Salt: | awk {'print $2'})
if [[ "." =~ .*"$SALTVERSIONPOSTUPGRADE".* ]]; then
SALTVERSIONPOSTUPGRADE=$SALTVERSIONPOSTUPGRADE
else
SALTVERSIONPOSTUPGRADE="${SALTVERSIONPOSTUPGRADE}.1"
fi
if [[ $(salt --versions-report | grep Salt: | awk {'print $2'}) != "$NEWSALTVERSION" ]]; then
echo "Salt upgrade failed. Check of indicators of failure in $SOUP_LOG."
echo "Once the issue is resolved, run soup again."