From 052391046e25ad3180ba704398b563853b32b9bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iwan=20Cl=C3=A9ment?= Date: Tue, 13 Mar 2018 11:19:56 +0000 Subject: [PATCH] =?UTF-8?q?Mettre=20=C3=A0=20jour=20'elastic/elastic=5Fins?= =?UTF-8?q?tall.sh'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- elastic/elastic_install.sh | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/elastic/elastic_install.sh b/elastic/elastic_install.sh index 7500786..5d779b9 100644 --- a/elastic/elastic_install.sh +++ b/elastic/elastic_install.sh @@ -1,19 +1,23 @@ #!/bin/bash -DESTDIR="/etc/yum.repos.d" -DESTFILE="elasticsearch.repo" -DESTFILE="$DESTDIR/$DESTFILE" #wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add - #echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-6.x.list #apt -y update && apt -y install elasticsearch -rpm -y --import https://artifacts.elastic.co/GPG-KEY-elasticsearch -echo "[elasticsearch-6.x]">"$DESTFILE" -echo "name=Elasticsearch repository for 6.x packages">>"$DESTFILE" -echo "baseurl=https://artifacts.elastic.co/packages/6.x/yum">>"$DESTFILE" -echo "echo "gpgcheck=1">>"$DESTFILE" -echo "gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch">>"$DESTFILE" -echo "enabled=1">>"$DESTFILE" -echo "autorefresh=1">>"$DESTFILE" -echo "type=rpm-md">>"$DESTFILE" +if [ -f /etc/redhat-release ]; then + DESTDIR="/etc/yum.repos.d" + DESTFILE="elasticsearch.repo" + DESTFILE="$DESTDIR/$DESTFILE" -yum install -y elasticsearch \ No newline at end of file + + rpm -y --import https://artifacts.elastic.co/GPG-KEY-elasticsearch + echo "[elasticsearch-6.x]">"$DESTFILE" + echo "name=Elasticsearch repository for 6.x packages">>"$DESTFILE" + echo "baseurl=https://artifacts.elastic.co/packages/6.x/yum">>"$DESTFILE" + echo "echo "gpgcheck=1">>"$DESTFILE" + echo "gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch">>"$DESTFILE" + echo "enabled=1">>"$DESTFILE" + echo "autorefresh=1">>"$DESTFILE" + echo "type=rpm-md">>"$DESTFILE" + + yum install -y elasticsearch +fi \ No newline at end of file