From bf0b31aa7f22798986905d87b83de7b7cdec9ed9 Mon Sep 17 00:00:00 2001 From: Bob Mottram <bob@freedombone.net> Date: Fri, 11 May 2018 15:11:01 +0100 Subject: [PATCH] Fix static analysis warnings --- src/freedombone-utils-firewall | 58 +++++++++++++++++----------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/freedombone-utils-firewall b/src/freedombone-utils-firewall index a0a505ea0..021df7ad9 100755 --- a/src/freedombone-utils-firewall +++ b/src/freedombone-utils-firewall @@ -54,10 +54,10 @@ function block_firefox_telemetry { # Within firefox source code see submit_telemetry_data.py if ! grep -q 'telemetry.mozilla' /etc/hosts; then - echo '127.0.0.1 telemetry.mozilla.org' >> /etc/hosts - echo '127.0.0.1 incoming.telemetry.mozilla.org' >> /etc/hosts + echo '127.0.0.1 telemetry.mozilla.org' >> /etc/hosts + echo '127.0.0.1 incoming.telemetry.mozilla.org' >> /etc/hosts fi - + if grep -q "$FIREFOX_TELEMETRY_IP" /etc/firewall.conf; then return fi @@ -360,32 +360,32 @@ function mesh_firewall { FIREWALL_FILENAME="${rootdir}/etc/systemd/system/meshfirewall.service" MESH_FIREWALL_SCRIPT=${rootdir}/usr/bin/mesh-firewall - if ! grep -q 'telemetry.mozilla' ${rootdir}/etc/hosts; then - echo '127.0.0.1 telemetry.mozilla.org' >> ${rootdir}/etc/hosts - echo '127.0.0.1 incoming.telemetry.mozilla.org' >> ${rootdir}/etc/hosts - fi - - if ! grep -q 'facebook' ${rootdir}/etc/hosts; then - { echo '127.0.0.1 www.facebook.com'; - echo '127.0.0.1 facebook.com'; - echo '127.0.0.1 static.ak.fbcdn.net'; - echo '127.0.0.1 www.static.ak.fbcdn.net'; - echo '127.0.0.1 login.facebook.com'; - echo '127.0.0.1 www.login.facebook.com'; - echo '127.0.0.1 fbcdn.net'; - echo '127.0.0.1 www.fbcdn.net'; - echo '127.0.0.1 fbcdn.com'; - echo '127.0.0.1 www.fbcdn.com'; - echo '127.0.0.1 static.ak.connect.facebook.com'; - echo '127.0.0.1 www.static.ak.connect.facebook.com'; } >> ${rootdir}/etc/hosts - fi - - if ! grep -q 'google' ${rootdir}/etc/hosts; then - { echo '127.0.0.1 www.google-analytics.com'; - echo '127.0.0.1 google-analytics.com'; - echo '127.0.0.1 ssl.google-analytics.com'; } >> ${rootdir}/etc/hosts - fi - + if ! grep -q 'telemetry.mozilla' "${rootdir}/etc/hosts"; then + echo '127.0.0.1 telemetry.mozilla.org' >> "${rootdir}/etc/hosts" + echo '127.0.0.1 incoming.telemetry.mozilla.org' >> "${rootdir}/etc/hosts" + fi + + if ! grep -q 'facebook' "${rootdir}/etc/hosts"; then + { echo '127.0.0.1 www.facebook.com'; + echo '127.0.0.1 facebook.com'; + echo '127.0.0.1 static.ak.fbcdn.net'; + echo '127.0.0.1 www.static.ak.fbcdn.net'; + echo '127.0.0.1 login.facebook.com'; + echo '127.0.0.1 www.login.facebook.com'; + echo '127.0.0.1 fbcdn.net'; + echo '127.0.0.1 www.fbcdn.net'; + echo '127.0.0.1 fbcdn.com'; + echo '127.0.0.1 www.fbcdn.com'; + echo '127.0.0.1 static.ak.connect.facebook.com'; + echo '127.0.0.1 www.static.ak.connect.facebook.com'; } >> "${rootdir}/etc/hosts" + fi + + if ! grep -q 'google' "${rootdir}/etc/hosts"; then + { echo '127.0.0.1 www.google-analytics.com'; + echo '127.0.0.1 google-analytics.com'; + echo '127.0.0.1 ssl.google-analytics.com'; } >> "${rootdir}/etc/hosts" + fi + { echo '#!/bin/bash'; echo 'iptables -P INPUT ACCEPT'; echo 'ip6tables -P INPUT ACCEPT'; -- GitLab