From 7afd539dbf720229fce8f783269e4e5a735cbb5d Mon Sep 17 00:00:00 2001 From: Giacomo Sanchietti Date: Mon, 20 Jun 2022 18:07:37 +0200 Subject: [PATCH] rsyslog: improve default config Check also for config files containing comment lines starting with white spaces. Signed-off-by: Giacomo Sanchietti --- admin/rsyslog/files/20_rsyslog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/admin/rsyslog/files/20_rsyslog b/admin/rsyslog/files/20_rsyslog index 6fd008a06..50fdbaab7 100644 --- a/admin/rsyslog/files/20_rsyslog +++ b/admin/rsyslog/files/20_rsyslog @@ -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