mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
Remove old airgap scripts
This commit is contained in:
@@ -1,64 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
. /usr/sbin/so-common
|
||||
|
||||
UPDATE_DIR=/tmp/sohotfixapply
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "No tarball given. Please provide the filename so I can run the hotfix"
|
||||
echo "so-airgap-hotfixapply /path/to/sohotfix.tar"
|
||||
exit 1
|
||||
else
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "Unable to find $1. Make sure your path is correct and retry."
|
||||
exit 1
|
||||
else
|
||||
echo "Determining if we need to apply this hotfix"
|
||||
rm -rf $UPDATE_DIR
|
||||
mkdir -p $UPDATE_DIR
|
||||
tar xvf $1 -C $UPDATE_DIR
|
||||
|
||||
# Compare some versions
|
||||
NEWVERSION=$(cat $UPDATE_DIR/VERSION)
|
||||
HOTFIXVERSION=$(cat $UPDATE_DIR/HOTFIX)
|
||||
CURRENTHOTFIX=$(cat /etc/sohotfix)
|
||||
INSTALLEDVERSION=$(cat /etc/soversion)
|
||||
|
||||
if [ "$INSTALLEDVERSION" == "$NEWVERSION" ]; then
|
||||
echo "Checking to see if there are hotfixes needed"
|
||||
if [ "$HOTFIXVERSION" == "$CURRENTHOTFIX" ]; then
|
||||
echo "You are already running the latest version of Security Onion."
|
||||
rm -rf $UPDATE_DIR
|
||||
exit 1
|
||||
else
|
||||
echo "We need to apply a hotfix"
|
||||
copy_new_files
|
||||
echo $HOTFIXVERSION > /etc/sohotfix
|
||||
salt-call state.highstate -l info queue=True
|
||||
echo "The Hotfix $HOTFIXVERSION has been applied"
|
||||
# Clean up
|
||||
rm -rf $UPDATE_DIR
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo "This hotfix is not compatible with your current version. Download the latest ISO and run soup"
|
||||
rm -rf $UPDATE_DIR
|
||||
fi
|
||||
|
||||
fi
|
||||
fi
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Get the latest code
|
||||
rm -rf /tmp/sohotfix
|
||||
mkdir -p /tmp/sohotfix
|
||||
cd /tmp/sohotfix
|
||||
git clone https://github.com/Security-Onion-Solutions/securityonion
|
||||
if [ ! -d "/tmp/sohotfix/securityonion" ]; then
|
||||
echo "I was unable to get the latest code. Check your internet and try again."
|
||||
exit 1
|
||||
else
|
||||
echo "Looks like we have the code lets create the tarball."
|
||||
cd /tmp/sohotfix/securityonion
|
||||
tar cvf /tmp/sohotfix/sohotfix.tar HOTFIX VERSION salt pillar
|
||||
echo ""
|
||||
echo "Copy /tmp/sohotfix/sohotfix.tar to portable media and then copy it to your airgap manager."
|
||||
exit 0
|
||||
fi
|
||||
Reference in New Issue
Block a user