fix vars and if statement

This commit is contained in:
m0duspwnens
2020-07-29 14:36:42 -04:00
parent 8a44d4752b
commit 171aa1178a

View File

@@ -165,7 +165,7 @@ upgrade_check_salt() {
if [ "$INSTALLEDSALTVERSION" == "$NEWSALTVERSION" ]; then if [ "$INSTALLEDSALTVERSION" == "$NEWSALTVERSION" ]; then
echo "You are already running the correct version of Salt for Security Onion." echo "You are already running the correct version of Salt for Security Onion."
else else
SALTUPGRADED = True SALTUPGRADED=True
echo "Performing upgrade of Salt from $INSTALLEDSALTVERSION to $NEWSALTVERSION" echo "Performing upgrade of Salt from $INSTALLEDSALTVERSION to $NEWSALTVERSION"
echo "" echo ""
# If CentOS # If CentOS
@@ -202,7 +202,7 @@ while getopts ":b" opt; do
case ${opt} in case ${opt} in
b ) # process option b b ) # process option b
if [[ $OPTARG =~ ^?[0-9]+$ ]] && [[ $OPTARG -gt 0 ]]; then if [[ $OPTARG =~ ^?[0-9]+$ ]] && [[ $OPTARG -gt 0 ]]; then
BATCHSIZE = $OPTARG BATCHSIZE=$OPTARG
else else
echo "Batch size must be a number greater than 0" echo "Batch size must be a number greater than 0"
fi fi
@@ -271,7 +271,7 @@ highstate
echo "" echo ""
echo "Upgrade from $INSTALLEDVERSION to $NEWVERSION complete." echo "Upgrade from $INSTALLEDVERSION to $NEWVERSION complete."
if [ SALTUPGRADED ]; then if [ "$SALTUPGRADED" = True ]; then
echo "" echo ""
echo "Upgrading the remaining Security Onion nodes from $INSTALLEDSALTVERSION to $NEWSALTVERSION" echo "Upgrading the remaining Security Onion nodes from $INSTALLEDSALTVERSION to $NEWSALTVERSION"
salt -C 'not *_eval and not *_helix and not *_manager and not *_managersearch and not *_standalone' -b $BATCHSIZE state.apply salt.minion salt -C 'not *_eval and not *_helix and not *_manager and not *_managersearch and not *_standalone' -b $BATCHSIZE state.apply salt.minion