Last active
February 27, 2018 18:05
-
-
Save thyn/e251649d4b29335b84dae91b46810102 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
user=elasticsearch | |
mkdir -p /elasticsearch | |
cd /elasticsearch | |
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.1.tar.gz | |
tar -xvf elasticsearch-5.6.1.tar.gz | |
mv elasticsearch-5.6.1 $1 | |
rm -rf elasticsearch-5.6.1.tar.gz | |
if [ $(getent passwd $user) ] ; then | |
echo user $user exists | |
else | |
echo user $user doesn\'t exists, creating | |
adduser elasticsearch | |
gpasswd -a elasticsearch elasticsearch | |
fi | |
mkdir -p /var/log/elasticsearch | |
sudo chown -R elasticsearch:elasticsearch /var/log/elasticsearch | |
sudo chown -R elasticsearch:elasticsearch /elasticsearch | |
sudo chown -R elasticsearch:elasticsearch /data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment