Can turn off prosody log

This commit is contained in:
Bob Mottram 2016-11-18 15:54:05 +00:00
parent 9a1e2f3f6b
commit d1ff074551
1 changed files with 5 additions and 2 deletions

View File

@ -72,9 +72,11 @@ if [[ "$1" == "on" || "$1" == "On" || "$1" == "ON" ]]; then
if [ -d /etc/prosody ]; then
if [ ! -d /var/log/prosody ]; then
mkdir /var/log/prosody
chown root:adm /var/log/prosody
fi
sed -i 's|info = "/dev/null";|info = "/var/log/prosody/prosody.log";|g' /etc/prosody/prosody.cfg.lua
sed -i 's|error = "/dev/null";|error = "/var/log/prosody/prosody.err";|g' /etc/prosody/prosody.cfg.lua
sed -i 's|levels = { "error" }; to = "/dev/null";|levels = { "error" }; to = "syslog";|g' /etc/prosody/prosody.cfg.lua
fi
if [ -d /etc/exim4 ]; then
if [ ! -d /var/log/exim4 ]; then
@ -132,8 +134,9 @@ else
if [ -d /etc/prosody ]; then
sed -i 's|info = "/var/log/prosody/prosody.log";|info = "/dev/null";|g' /etc/prosody/prosody.cfg.lua
sed -i 's|error = "/var/log/prosody/prosody.err";|error = "/dev/null";|g' /etc/prosody/prosody.cfg.lua
shred -zu /var/log/prosody/prosody.log
shred -zu /var/log/prosody/prosody.err
sed -i 's|levels = { "error" }; to = "syslog";|levels = { "error" }; to = "/dev/null";|g' /etc/prosody/prosody.cfg.lua
shred -zu /var/log/prosody/*
rm -rf /var/log/prosody
fi
if [ -d /etc/exim4 ]; then
sed -i 's|log_selector =.*|log_selector = -all|g' /etc/exim4/conf.d/main/90_exim4-config_log_selector