diff --git a/src/freedombone-app-turtl b/src/freedombone-app-turtl
index f5909c4847074283acd15a3e5c22af450fc6cabb..87d200f1b6701d7c3e5c4eab506b39910743b302 100755
--- a/src/freedombone-app-turtl
+++ b/src/freedombone-app-turtl
@@ -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
 }
diff --git a/src/freedombone-app-xmpp b/src/freedombone-app-xmpp
index aa0f2f710c634bd8637d54699b48bd04a3c32ec3..1eff54f0f2cfa3222ce4f854662faf35564d79da 100755
--- a/src/freedombone-app-xmpp
+++ b/src/freedombone-app-xmpp
@@ -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