Skip to content
Snippets Groups Projects
Commit edc3a835 authored by Bob Mottram's avatar Bob Mottram
Browse files

Logging only if installed

parent a8d86ae2
No related branches found
No related tags found
No related merge requests found
......@@ -74,11 +74,17 @@ function turtl_setting_registration {
}
function logging_on_turtl {
if [ ! -d /etc/turtl ]; then
return
fi
sed -i "s|loglevel:.*|loglevel: 'debug'|g" /etc/turtl/config/config.yaml
systemctl restart turtl
}
function logging_off_turtl {
if [ ! -d /etc/turtl ]; then
return
fi
sed -i "s|loglevel:.*|loglevel: 'error'|g" /etc/turtl/config/config.yaml
systemctl restart turtl
}
......
......@@ -165,6 +165,10 @@ function xmpp_update_e2e_policy {
}
function logging_on_xmpp {
if [ ! -d /etc/prosody ]; then
return
fi
if ! grep -q 'info = "/var/log/prosody/prosody.log";' /etc/prosody/prosody.cfg.lua; then
if [ -d /etc/prosody ]; then
if [ ! -d /var/log/prosody ]; then
......@@ -186,6 +190,10 @@ function logging_on_xmpp {
}
function logging_off_xmpp {
if [ ! -d /etc/prosody ]; then
return
fi
if ! grep -q '/dev/null' /etc/prosody/prosody.cfg.lua; then
if [ -d /etc/prosody ]; then
if grep -q "/var/log/prosody/prosody.log" /etc/prosody/prosody.cfg.lua; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment