Merge pull request #1346 from Security-Onion-Solutions/rc3upgrade

Rc3upgrade
This commit is contained in:
Mike Reeves
2020-09-16 14:29:53 -04:00
committed by GitHub

View File

@@ -38,7 +38,8 @@ manager_check() {
clean_dockers() { clean_dockers() {
# Place Holder for cleaning up old docker images # Place Holder for cleaning up old docker images
echo "" echo "Trying to clean up old dockers."
docker system prune -a -f
} }
clone_to_tmp() { clone_to_tmp() {
@@ -185,6 +186,18 @@ rc2_to_rc3() {
} }
space_check() {
# Check to see if there is enough space
CURRENTSPACE=$(df -BG / | grep -v Avail | awk '{print $4}' | sed 's/.$//')
if [ "$CURRENTSPACE" -lt "10" ]; then
echo "You are low on disk space. Upgrade will try and clean up space.";
clean_dockers
else
echo "Plenty of space for upgrading"
fi
}
update_dockers() { update_dockers() {
# List all the containers # List all the containers
if [ $MANAGERCHECK == 'so-import' ]; then if [ $MANAGERCHECK == 'so-import' ]; then
@@ -366,7 +379,7 @@ echo ""
echo "Let's see if we need to update Security Onion." echo "Let's see if we need to update Security Onion."
upgrade_check upgrade_check
space_check
echo "" echo ""
echo "Performing upgrade from Security Onion $INSTALLEDVERSION to Security Onion $NEWVERSION." echo "Performing upgrade from Security Onion $INSTALLEDVERSION to Security Onion $NEWVERSION."
@@ -385,8 +398,6 @@ echo "Making pillar changes."
pillar_changes pillar_changes
echo "" echo ""
echo "Cleaning up old dockers."
clean_dockers
echo "" echo ""
echo "Updating dockers to $NEWVERSION." echo "Updating dockers to $NEWVERSION."
update_dockers update_dockers