#!/bin/bash
ETC=/etc/rsyslog.conf
LOG=/etc/logrotate.d/rsyslog.local

if grep -qP '^\*\.\* \?remote$' $ETC; then
  sed -ri 's/^(\*\.\* \?remote)$/#\1/' $ETC
  /etc/rc.d/rc.rsyslogd restart &> /dev/null
fi
if [[ -f $LOG ]]; then
  rm -f $LOG
fi
