From 41f65f1f5a6a68c32adb95a5d3b3657b8a7f13a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 3 Sep 2014 09:59:59 +0200 Subject: [PATCH] firewall: show error message only on actual error --- network/qubes-firewall | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/network/qubes-firewall b/network/qubes-firewall index 0b8da66..9f8aa44 100755 --- a/network/qubes-firewall +++ b/network/qubes-firewall @@ -41,11 +41,13 @@ while true; do for i in $(xenstore-list qubes-iptables-domainrules) ; do RULES=$(/usr/bin/xenstore-read qubes-iptables-domainrules/"$i") ERRS=`echo -e "$RULES" | /sbin/iptables-restore -n 2>&1 || true` - echo "Failed applying rules for $i: $ERRS" >&2 - OUT="$OUT$ERRS" + if [ -n "$ERRS" ]; then + echo "Failed applying rules for $i: $ERRS" >&2 + OUT="$OUT$ERRS" + fi done /usr/bin/xenstore-write $XENSTORE_ERROR "$OUT" - if [ "$OUT" ]; then + if [ -n "$OUT" ]; then DISPLAY=:0 /usr/bin/notify-send -t 3000 "Firewall loading error ($HOSTNAME)" "$OUT" || : fi