File tree Expand file tree Collapse file tree 3 files changed +38
-5
lines changed Expand file tree Collapse file tree 3 files changed +38
-5
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- # Copyright 2018 Splunk
3
+ # Copyright 2018-2020 Splunk
4
4
5
5
# Licensed under the Apache License, Version 2.0 (the "License");
6
6
# you may not use this file except in compliance with the License.
15
15
# limitations under the License.
16
16
#
17
17
18
- if [[ -f " ${SPLUNK_HOME} -etc/splunk.version" ]]; then
19
- IMAGE_VERSION_SHA=` cat ${SPLUNK_HOME} -etc/splunk.version | sha512sum`
18
+ SPLUNK_ETC_BAK=" ${SPLUNK_ETC_BAK:-/ opt/ splunk-etc} "
19
+
20
+ if [[ -f " ${SPLUNK_ETC_BAK} /splunk.version" ]]; then
21
+ IMAGE_VERSION_SHA=` cat ${SPLUNK_ETC_BAK} /splunk.version | sha512sum`
20
22
21
23
if [[ -f " ${SPLUNK_HOME} /etc/splunk.version" ]]; then
22
24
ETC_VERSION_SHA=` cat ${SPLUNK_HOME} /etc/splunk.version | sha512sum`
23
25
fi
24
26
25
27
if [[ " x${IMAGE_VERSION_SHA} " != " x${ETC_VERSION_SHA} " ]]; then
26
28
echo Updating ${SPLUNK_HOME} /etc
27
- (cd ${SPLUNK_HOME} -etc ; tar cf - * ) | (cd ${SPLUNK_HOME} /etc; tar xf -)
29
+ (cd ${SPLUNK_ETC_BAK} ; tar cf - * ) | (cd ${SPLUNK_HOME} /etc; tar xf -)
28
30
fi
29
31
fi
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ ENV SPLUNK_HOME=/opt/splunkforwarder \
47
47
SPLUNK_USER=splunk
48
48
49
49
# Simple script used to populate/upgrade splunk/etc directory
50
- COPY [ "splunk /common-files/updateetc.sh" , "/sbin/" ]
50
+ COPY [ "uf /common-files/updateetc.sh" , "/sbin/" ]
51
51
52
52
# Setup users and groups
53
53
RUN groupadd -r -g ${GID} ${SPLUNK_GROUP} \
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Copyright 2018-2020 Splunk
4
+
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ SPLUNK_ETC_BAK=" ${SPLUNK_ETC_BAK:-/ opt/ splunkforwarder-etc} "
19
+
20
+ if [[ -f " ${SPLUNK_ETC_BAK} /splunk.version" ]]; then
21
+ IMAGE_VERSION_SHA=` cat ${SPLUNK_ETC_BAK} /splunk.version | sha512sum`
22
+
23
+ if [[ -f " ${SPLUNK_HOME} /etc/splunk.version" ]]; then
24
+ ETC_VERSION_SHA=` cat ${SPLUNK_HOME} /etc/splunk.version | sha512sum`
25
+ fi
26
+
27
+ if [[ " x${IMAGE_VERSION_SHA} " != " x${ETC_VERSION_SHA} " ]]; then
28
+ echo Updating ${SPLUNK_HOME} /etc
29
+ (cd ${SPLUNK_ETC_BAK} ; tar cf - * ) | (cd ${SPLUNK_HOME} /etc; tar xf -)
30
+ fi
31
+ fi
You can’t perform that action at this time.
0 commit comments