File tree 3 files changed +31
-9
lines changed
distribution/packages/src/common/scripts 3 files changed +31
-9
lines changed Original file line number Diff line number Diff line change 8
8
# $1=0 : indicates a removal
9
9
# $1=1 : indicates an upgrade
10
10
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
+
11
18
IS_UPGRADE=false
12
19
13
20
case "$1" in
95
102
96
103
# the equivalent code for rpm is in posttrans
97
104
if [ "$PACKAGE" = "deb" ]; then
98
- if [ ! -f /etc/elasticsearch /elasticsearch.keystore ]; then
105
+ if [ ! -f "${ES_PATH_CONF}" /elasticsearch.keystore ]; then
99
106
/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
103
110
else
104
111
/usr/share/elasticsearch/bin/elasticsearch-keystore upgrade
105
112
fi
Original file line number Diff line number Diff line change 8
8
# On RedHat,
9
9
# $1=0 : indicates a removal
10
10
# $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
+
11
19
REMOVE_DIRS=false
12
20
REMOVE_USER_AND_GROUP=false
13
21
@@ -73,8 +81,8 @@ if [ "$REMOVE_DIRS" = "true" ]; then
73
81
fi
74
82
75
83
# 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}"
78
86
fi
79
87
80
88
fi
Original file line number Diff line number Diff line change 9
9
# $1=0 : indicates a removal
10
10
# $1=1 : indicates an upgrade
11
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
+
12
19
STOP_REQUIRED=false
13
20
REMOVE_SERVICE=false
14
21
@@ -65,9 +72,9 @@ if [ "$STOP_REQUIRED" = "true" ]; then
65
72
echo " OK"
66
73
fi
67
74
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
71
78
fi
72
79
fi
73
80
You can’t perform that action at this time.
0 commit comments