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 11#! /bin/bash
22
3- # Copyright 2018 Splunk
3+ # Copyright 2018-2020 Splunk
44
55# Licensed under the Apache License, Version 2.0 (the "License");
66# you may not use this file except in compliance with the License.
1515# limitations under the License.
1616#
1717
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`
2022
2123 if [[ -f " ${SPLUNK_HOME} /etc/splunk.version" ]]; then
2224 ETC_VERSION_SHA=` cat ${SPLUNK_HOME} /etc/splunk.version | sha512sum`
2325 fi
2426
2527 if [[ " x${IMAGE_VERSION_SHA} " != " x${ETC_VERSION_SHA} " ]]; then
2628 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 -)
2830 fi
2931fi
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ ENV SPLUNK_HOME=/opt/splunkforwarder \
4747 SPLUNK_USER=splunk
4848
4949# 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/" ]
5151
5252# Setup users and groups
5353RUN 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