HEX
Server: nginx/1.16.1
System: Linux ecs-04358622 4.19.90-2107.6.0.0100.oe1.bclinux.x86_64 #1 SMP Wed Dec 1 19:59:44 CST 2021 x86_64
User: nginx (994)
PHP: 8.0.0
Disabled: NONE
Upload Files
File: //opt/BCLinux/bse/secure_set/s19_syslogError
#!/bin/sh

#=====================================================================
InsertSection "Recording the error events..."

if [ $RECORDING_ERROR_EVENTS -eq 1 ]; then

    cp -np /etc/rsyslog.conf /etc/rsyslog.conf_bak


    #--------------recording the err events--------------
    IS_EXIST=`egrep -v '^$|^#' /etc/rsyslog.conf | grep -E '^*.err' | grep "*.err \{1,\}\/var\/log\/.\{1,\}" | wc -l`
    if [ "${IS_EXIST}" = "0" ] ; then
        echo " " >> /etc/rsyslog.conf
        echo "*.err /var/log/${ERROR_FILE_NAME}" >> /etc/rsyslog.conf
    else
        echo "has *.err set, passing..."
    fi

    # restart the syslog service
    #systemctl restart rsyslog

    Display --indent 2 --text "- Setting the rsyslog.conf, recording the error events... " --result FINISHED --color GREEN

else

    Display --indent 2 --text "- Skip recording the error events due to config file... " --result SKIPPING --color YELLOW

fi