Skip to content

Commit ab4d63a

Browse files
author
Nelson Wang
committed
Applying fix for uf as well
1 parent 9b08e27 commit ab4d63a

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

uf/common-files/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
5353
RUN groupadd -r -g ${GID} ${SPLUNK_GROUP} \

uf/common-files/updateetc.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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

0 commit comments

Comments
 (0)