Last active
March 28, 2017 22:26
-
-
Save thyn/e9f254a1aa67a19d10bfcd6026911817 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://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.4.4/elasticsearch-2.4.4.tar.gz | |
tar -xvf elasticsearch-2.4.4.tar.gz | |
mv elasticsearch-2.4.4 $1 | |
rm -rf elasticsearch-2.4.4.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