syslog event script made conditional execution

This commit is contained in:
bergware
2019-02-05 09:19:11 +01:00
parent c323e002d5
commit 84feabb3bb
2 changed files with 2 additions and 2 deletions
@@ -1,6 +1,6 @@
#!/bin/bash
ETC=/etc/rsyslog.conf
if grep '/^#\*\.\* \?remote$' $ETC; then
if grep -q '/^#\*\.\* \?remote$' $ETC; then
sed -ri 's/^#(\*\.\* \?remote)$/\1/' $ETC
/etc/rc.d/rc.rsyslogd restart &> /dev/null
fi
@@ -1,6 +1,6 @@
#!/bin/bash
ETC=/etc/rsyslog.conf
if grep '/^\*\.\* \?remote$' $ETC; then
if grep -q '/^\*\.\* \?remote$' $ETC; then
sed -ri 's/^(\*\.\* \?remote)$/#\1/' $ETC
/etc/rc.d/rc.rsyslogd restart &> /dev/null
fi