Created
April 23, 2019 14:43
-
-
Save djcp/40a03258dcdd680ff291f85f26066cf0 to your computer and use it in GitHub Desktop.
Super simple elasticsearch init
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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