Skip to content

Instantly share code, notes, and snippets.

@djcp
Created April 23, 2019 14:43
Show Gist options
  • Save djcp/40a03258dcdd680ff291f85f26066cf0 to your computer and use it in GitHub Desktop.
Save djcp/40a03258dcdd680ff291f85f26066cf0 to your computer and use it in GitHub Desktop.
Super simple elasticsearch init
#! /bin/sh
# TODO: check for openjdk-8-jre and fail out
DIR=~/code/work/elasticsearch
start_es(){
./elasticsearch-5.6.16/bin/elasticsearch
}
install_es(){
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.16.tar.gz
tar xvfz elasticsearch-5.6.16.tar.gz
}
if [ -d "$DIR" ]; then
# Directory exists.
cd "$DIR"
start_es
else
# No directory, reinitialize state
mkdir -p "$DIR"
cd "$DIR"
install_es
start_es
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment