File tree Expand file tree Collapse file tree 3 files changed +31
-9
lines changed
distribution/packages/src/common/scripts Expand file tree Collapse file tree 3 files changed +31
-9
lines changed Original file line number Diff line number Diff line change 88# $1=0 : indicates a removal
99# $1=1 : indicates an upgrade
1010
11+ # source the default env file
12+ if [ -f "${path.env}" ]; then
13+ . "${path.env}"
14+ else
15+ ES_PATH_CONF="${path.conf}"
16+ fi
17+
1118IS_UPGRADE=false
1219
1320case "$1" in
95102
96103# the equivalent code for rpm is in posttrans
97104if [ "$PACKAGE" = "deb" ]; then
98- if [ ! -f /etc/elasticsearch /elasticsearch.keystore ]; then
105+ if [ ! -f "${ES_PATH_CONF}" /elasticsearch.keystore ]; then
99106 /usr/share/elasticsearch/bin/elasticsearch-keystore create
100- chown root:elasticsearch /etc/elasticsearch /elasticsearch.keystore
101- chmod 660 /etc/elasticsearch /elasticsearch.keystore
102- md5sum /etc/ elasticsearch/elasticsearch .keystore > /etc/elasticsearch /.elasticsearch.keystore.initial_md5sum
107+ chown root:elasticsearch "${ES_PATH_CONF}" /elasticsearch.keystore
108+ chmod 660 "${ES_PATH_CONF}" /elasticsearch.keystore
109+ md5sum "${ES_PATH_CONF}"/ elasticsearch.keystore > "${ES_PATH_CONF}" /.elasticsearch.keystore.initial_md5sum
103110 else
104111 /usr/share/elasticsearch/bin/elasticsearch-keystore upgrade
105112 fi
Original file line number Diff line number Diff line change 88# On RedHat,
99# $1=0 : indicates a removal
1010# $1=1 : indicates an upgrade
11+
12+ # source the default env file
13+ if [ -f "${path.env}" ]; then
14+ . "${path.env}"
15+ else
16+ ES_PATH_CONF="${path.conf}"
17+ fi
18+
1119REMOVE_DIRS=false
1220REMOVE_USER_AND_GROUP=false
1321
@@ -73,8 +81,8 @@ if [ "$REMOVE_DIRS" = "true" ]; then
7381 fi
7482
7583 # delete the conf directory if and only if empty
76- if [ -d /etc/elasticsearch ]; then
77- rmdir --ignore-fail-on-non-empty /etc/elasticsearch
84+ if [ -d "${ES_PATH_CONF}" ]; then
85+ rmdir --ignore-fail-on-non-empty "${ES_PATH_CONF}"
7886 fi
7987
8088fi
Original file line number Diff line number Diff line change 99# $1=0 : indicates a removal
1010# $1=1 : indicates an upgrade
1111
12+ # source the default env file
13+ if [ -f "${path.env}" ]; then
14+ . "${path.env}"
15+ else
16+ ES_PATH_CONF="${path.conf}"
17+ fi
18+
1219STOP_REQUIRED=false
1320REMOVE_SERVICE=false
1421
@@ -65,9 +72,9 @@ if [ "$STOP_REQUIRED" = "true" ]; then
6572 echo " OK"
6673fi
6774
68- if [ -f /etc/elasticsearch /elasticsearch.keystore ]; then
69- if md5sum --status -c /etc/elasticsearch /.elasticsearch.keystore.initial_md5sum; then
70- rm /etc/ elasticsearch/elasticsearch .keystore /etc/elasticsearch /.elasticsearch.keystore.initial_md5sum
75+ if [ -f "${ES_PATH_CONF}" /elasticsearch.keystore ]; then
76+ if md5sum --status -c "${ES_PATH_CONF}" /.elasticsearch.keystore.initial_md5sum; then
77+ rm "${ES_PATH_CONF}"/ elasticsearch.keystore "${ES_PATH_CONF}" /.elasticsearch.keystore.initial_md5sum
7178 fi
7279fi
7380
You can’t perform that action at this time.
0 commit comments