rsyslog: improve default config
authorGiacomo Sanchietti <giacomo.sanchietti@nethesis.it>
Mon, 20 Jun 2022 16:07:37 +0000 (18:07 +0200)
committerRosen Penev <rosenp@gmail.com>
Thu, 7 Jul 2022 17:34:58 +0000 (10:34 -0700)
Check also for config files containing comment lines starting
with white spaces.

Signed-off-by: Giacomo Sanchietti <giacomo.sanchietti@nethesis.it>
admin/rsyslog/files/20_rsyslog

index 6fd008a0662bdf35c45b590c361f28ff2b9d8522..50fdbaab735d69f55d58836d6e312cb15107238c 100644 (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