Merge pull request #18 from linuxserver/conf-ver

This commit is contained in:
Adam 2023-06-15 13:21:12 +01:00 committed by GitHub
commit b43d8455ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 4 deletions

View File

@ -15,6 +15,7 @@ RUN \
&& awk '/^P:syslog-ng$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
fi && \
apk add -U --upgrade --no-cache \
grep \
libdbi-drivers \
paho-mqtt-c \
py3-syslog-ng \

View File

@ -15,6 +15,7 @@ RUN \
&& awk '/^P:syslog-ng$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
fi && \
apk add -U --upgrade --no-cache \
grep \
libdbi-drivers \
paho-mqtt-c \
py3-syslog-ng \

View File

@ -2,7 +2,7 @@
# Default syslog-ng.conf file which collects all local logs into a
# single file called /var/log/messages tailored to container usage.
@version: 3.35
@version: 4.1
@include "scl.conf"
source s_local {
@ -27,4 +27,4 @@ log {
source(s_network_tcp);
source(s_network_udp);
destination(d_local);
};
};

View File

@ -6,8 +6,10 @@ if [[ ! -f "/config/syslog-ng.conf" ]]; then
cp -a /defaults/syslog-ng.conf /config/syslog-ng.conf
fi
if [[ -f "/config/syslog-ng.conf" ]] && [[ $(grep "@version: 3.29" "/config/syslog-ng.conf") ]]; then
SYSLOG_VERSION=$(syslog-ng --version | grep "Config version" | awk -F ':' '{print $2}' | tr -d '[:space:]')
CONF_VERSION=$(grep -oP "@version: \K(\d+\.\d+)" "/config/syslog-ng.conf")
SYSLOG_VERSION=$(syslog-ng --version | grep "Config version" | awk -F ':' '{print $2}' | tr -d '[:space:]')
if [[ -f "/config/syslog-ng.conf" ]] && (( $(bc -l <<< "${CONF_VERSION} < ${SYSLOG_VERSION}") )); then
cat <<-EOF
********************************************************
********************************************************