Skip to content

Commit b43d845

Browse files
authored
Merge pull request #18 from linuxserver/conf-ver
2 parents 742a3a3 + 7b264a6 commit b43d845

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ RUN \
1515
&& awk '/^P:syslog-ng$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
1616
fi && \
1717
apk add -U --upgrade --no-cache \
18+
grep \
1819
libdbi-drivers \
1920
paho-mqtt-c \
2021
py3-syslog-ng \

Dockerfile.aarch64

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ RUN \
1515
&& awk '/^P:syslog-ng$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
1616
fi && \
1717
apk add -U --upgrade --no-cache \
18+
grep \
1819
libdbi-drivers \
1920
paho-mqtt-c \
2021
py3-syslog-ng \

root/defaults/syslog-ng.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Default syslog-ng.conf file which collects all local logs into a
33
# single file called /var/log/messages tailored to container usage.
44

5-
@version: 3.35
5+
@version: 4.1
66
@include "scl.conf"
77

88
source s_local {
@@ -27,4 +27,4 @@ log {
2727
source(s_network_tcp);
2828
source(s_network_udp);
2929
destination(d_local);
30-
};
30+
};

root/etc/s6-overlay/s6-rc.d/init-syslog-ng-config/run

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ if [[ ! -f "/config/syslog-ng.conf" ]]; then
66
cp -a /defaults/syslog-ng.conf /config/syslog-ng.conf
77
fi
88

9-
if [[ -f "/config/syslog-ng.conf" ]] && [[ $(grep "@version: 3.29" "/config/syslog-ng.conf") ]]; then
10-
SYSLOG_VERSION=$(syslog-ng --version | grep "Config version" | awk -F ':' '{print $2}' | tr -d '[:space:]')
9+
CONF_VERSION=$(grep -oP "@version: \K(\d+\.\d+)" "/config/syslog-ng.conf")
10+
SYSLOG_VERSION=$(syslog-ng --version | grep "Config version" | awk -F ':' '{print $2}' | tr -d '[:space:]')
11+
12+
if [[ -f "/config/syslog-ng.conf" ]] && (( $(bc -l <<< "${CONF_VERSION} < ${SYSLOG_VERSION}") )); then
1113
cat <<-EOF
1214
********************************************************
1315
********************************************************

0 commit comments

Comments
 (0)