Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evebox - pre and post upgrade scripts #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Scripts/Configs/Evebox/etc/apt/sources.list.d/evebox.list
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deb http://files.evebox.org/evebox/debian stable main
2 changes: 2 additions & 0 deletions Scripts/Configs/Evebox/etc/default/evebox
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ELASTICSEARCH_URL="-e http://localhost:9200"
EVEBOX_OPTS="--host localhost"
31 changes: 30 additions & 1 deletion Scripts/Setup/selks-upgrade_stamus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,43 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

set -e

pre_upgrade_evebox() {
# Make sure repo URL is current and the key is installed.
cp /opt/selks/Scripts/Configs/Evebox/etc/apt/sources.list.d/evebox.list \
/etc/apt/sources.list.d/
if ! apt-key list | grep -q 8B15B19F; then
wget -O - -q https://evebox.org/files/GPG-KEY-evebox | apt-key add -
fi
/bin/systemctl stop evebox
}

post_upgrade_evebox() {
# Copy in the SELKS specific default file.
cp /opt/selks/Scripts/Configs/Evebox/etc/default/evebox \
/etc/default/evebox
/bin/systemctl start evebox
}

upgrade_evebox() {
apt-get install -o Dpkg::Options::="--force-confdef" \
-o Dpkg::Options::="--force-confold" evebox
}

/bin/systemctl stop kibana
/usr/share/elasticsearch/bin/plugin remove delete-by-query

apt-get update && apt-get dist-upgrade
pre_upgrade_evebox

apt-get update
upgrade_evebox
apt-get dist-upgrade

chown -R kibana /opt/kibana/optimize/
/usr/share/elasticsearch/bin/plugin install delete-by-query

/bin/systemctl restart elasticsearch
/bin/systemctl restart kibana

post_upgrade_evebox