rsyslog: improve default config

Check also for config files containing comment lines starting
with white spaces.

Signed-off-by: Giacomo Sanchietti <giacomo.sanchietti@nethesis.it>
This commit is contained in:
Giacomo Sanchietti 2022-06-20 18:07:37 +02:00 committed by Rosen Penev
parent c3f6591de7
commit 7afd539dbf
1 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,6 @@
[ "$(sed -e '/^#/d' -e '/^\s*$/d' /etc/rsyslog.conf)" != "" ] && exit 0
#!/bin/sh
grep -qv -e '^\s*#' -e '^\s*$' /etc/rsyslog.conf 2>/dev/null && exit 0
[ "$(uci -q get rsyslog.syslog)" == "syslog" ] && exit 0
uci -q import rsyslog << EOI