Files
webgui/plugins/dynamix/event/disks_mounted/local_syslog_start
2019-02-27 17:14:34 +01:00

14 lines
306 B
Bash
Executable File

#!/bin/bash
ETC=/etc/rsyslog.conf
USB=/boot/config/rsyslog.local
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
if [[ -f $USB ]]; then
cp -f $USB $LOG
chmod 644 $LOG
fi
fi