change output wording, add periods

This commit is contained in:
m0duspwnens
2020-07-30 13:35:09 -04:00
parent a562d70fe2
commit 6812d3f5c5

View File

@@ -26,7 +26,7 @@ manager_check() {
# Check to see if this is a manager # Check to see if this is a manager
MANAGERCHECK=$(cat /etc/salt/grains | grep role | awk '{print $2}') MANAGERCHECK=$(cat /etc/salt/grains | grep role | awk '{print $2}')
if [[ "$MANAGERCHECK" =~ ^('so-eval'|'so-manager'|'so-standalone'|'so-managersearch')$ ]]; then if [[ "$MANAGERCHECK" =~ ^('so-eval'|'so-manager'|'so-standalone'|'so-managersearch')$ ]]; then
echo "This is a manager. We can proceed" echo "This is a manager. We can proceed."
else else
echo "Please run soup on the manager. The manager controls all updates." echo "Please run soup on the manager. The manager controls all updates."
exit 0 exit 0
@@ -75,7 +75,7 @@ highstate() {
pillar_changes() { pillar_changes() {
# This function is to add any new pillar items if needed. # This function is to add any new pillar items if needed.
echo "Checking to see if pillar changes are needed" echo "Checking to see if pillar changes are needed."
} }
@@ -145,7 +145,7 @@ update_dockers() {
update_version() { update_version() {
# Update the version to the latest # Update the version to the latest
echo "Updating the version file." echo "Updating the Security Onion version file."
echo $NEWVERSION > /etc/soversion echo $NEWVERSION > /etc/soversion
sed -i "s/$INSTALLEDVERSION/$NEWVERSION/g" /opt/so/saltstack/local/pillar/static.sls sed -i "s/$INSTALLEDVERSION/$NEWVERSION/g" /opt/so/saltstack/local/pillar/static.sls
} }
@@ -165,16 +165,16 @@ upgrade_check_salt() {
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
echo "Removing yum versionlock for Salt" echo "Removing yum versionlock for Salt."
echo "" echo ""
yum versionlock delete "salt-*" yum versionlock delete "salt-*"
echo "Updating Salt packages and restarting services" echo "Updating Salt packages and restarting services."
echo "" echo ""
sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -F -M -x python3 stable "$NEWSALTVERSION" sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -F -M -x python3 stable "$NEWSALTVERSION"
echo "Applying yum versionlock for Salt" echo "Applying yum versionlock for Salt."
echo "" echo ""
yum versionlock add "salt-*" yum versionlock add "salt-*"
# Else do Ubuntu things # Else do Ubuntu things
@@ -203,7 +203,7 @@ while getopts ":b" opt; do
shift shift
BATCHSIZE=$1 BATCHSIZE=$1
if ! [[ "$BATCHSIZE" =~ ^[0-9]+$ ]]; then if ! [[ "$BATCHSIZE" =~ ^[0-9]+$ ]]; then
echo "Batch size must be a number greater than 0" echo "Batch size must be a number greater than 0."
exit 1 exit 1
fi fi
;; ;;
@@ -212,57 +212,56 @@ while getopts ":b" opt; do
esac esac
done done
echo "Checking to see if this is a manager" echo "Checking to see if this is a manager."
manager_check manager_check
echo "Cloning latest code to a temporary location" echo "Cloning Security Onion github repo into $UPDATE_DIR."
clone_to_tmp clone_to_tmp
echo "" echo ""
echo "Verifying we have the latest script" echo "Verifying we have the latest soup script."
verify_latest_update_script verify_latest_update_script
echo "" echo ""
echo "Let's see if we need to update" echo "Let's see if we need to update Security Onion."
upgrade_check upgrade_check
echo "" echo ""
echo "Performing Upgrade from $INSTALLEDVERSION to $NEWVERSION" echo "Performing upgrade from Security Onion $INSTALLEDVERSION to Security Onion $NEWVERSION."
echo "" echo ""
echo "Stopping Salt Minion service" echo "Stopping Salt Minion service."
systemctl stop salt-minion systemctl stop salt-minion
echo "" echo ""
echo "Stopping Salt Master service" echo "Stopping Salt Master service."
systemctl stop salt-master systemctl stop salt-master
echo "" echo ""
echo "Checking for Salt updates" echo "Checking for Salt master and minion updates."
upgrade_check_salt upgrade_check_salt
echo "Making pillar changes" echo "Making pillar changes."
pillar_changes pillar_changes
echo "" echo ""
echo "Cleaning up old dockers" echo "Cleaning up old dockers."
clean_dockers clean_dockers
echo "" echo ""
echo "Updating docker to $NEWVERSION" echo "Updating dockers to $NEWVERSION."
update_dockers update_dockers
echo "" echo ""
echo "Copying new code" echo "Copying new Security Onion code from $UPDATE_DIR to $default_salt_dir."
copy_new_files copy_new_files
echo "" echo ""
echo "Updating version"
update_version update_version
echo "" echo ""
echo "Starting Salt Master service" echo "Starting Salt Master service."
systemctl start salt-master systemctl start salt-master
echo "" echo ""
echo "Running a highstate to complete upgrade" echo "Running a highstate to complete the upgrade."
highstate highstate
echo "" echo ""
echo "Upgrade from $INSTALLEDVERSION to $NEWVERSION complete." echo "Upgrade from $INSTALLEDVERSION to $NEWVERSION complete."