diff --git a/src/freedombone-app-matrix b/src/freedombone-app-matrix
index fb2c17ed7a4f65714a737fde16a7fadfd22f0cec..308d5203cbfc60a121b96d3285b3413c0a50cf14 100755
--- a/src/freedombone-app-matrix
+++ b/src/freedombone-app-matrix
@@ -59,7 +59,7 @@ function matrix_nginx {
 
     # append the matrix server to the web site config
     matrix_nginx_site=/etc/nginx/sites-available/$DEFAULT_DOMAIN_NAME
-    if ! grep "# End of Matrix Server" $matrix_nginx_site; then
+    if ! grep -q "# End of Matrix Server" $matrix_nginx_site; then
         if [[ $ONION_ONLY == "no" ]]; then
             echo '# Matrix Server' >> $matrix_nginx_site
             echo 'server {' >> $matrix_nginx_site
diff --git a/src/freedombone-utils-turn b/src/freedombone-utils-turn
index 492ecb4e6694dc0409526fd3067f2e926ea622dd..9db64d4eaa276907bed58de6ca0898f84167369f 100755
--- a/src/freedombone-utils-turn
+++ b/src/freedombone-utils-turn
@@ -65,7 +65,7 @@ function install_turn {
 
     # append the matrix server to the web site config
     turn_nginx_site=/etc/nginx/sites-available/$DEFAULT_DOMAIN_NAME
-    if ! grep "# End of TURN Server" $turn_nginx_site; then
+    if ! grep -q "# End of TURN Server" $turn_nginx_site; then
         if [[ $ONION_ONLY == "no" ]]; then
             echo '# TURN Server' >> $turn_nginx_site
             echo 'server {' >> $turn_nginx_site