Izmjene za buster. debian/0.10.2+cn10u1
authorIvan Rako <ivan.rako@srce.hr>
Sun, 27 Dec 2020 22:04:16 +0000 (23:04 +0100)
committerIvan Rako <ivan.rako@srce.hr>
Sun, 27 Dec 2020 22:04:16 +0000 (23:04 +0100)
debian/postinst

index 37638c7..3d47138 100755 (executable)
@@ -49,11 +49,18 @@ if [ -e "$CONF" ]; then
     cp_get_netaddr || true
     NETADDR="$RET"
     IGNOREIP=$(grep '^ignoreip' "$CONF")
-    if ! echo "$IGNOREIP" | grep -q "$NETADDR"; then
-       echo "CN: Enabling local IP ranges exclusion..."
-       cp_check_and_sed '^ignoreip' \
-            "s;^\(ignoreip.*\)$;\1 $NETADDR;g" "$CONF" || true
-    fi
+    if grep -q '^ignoreip' "$CONF"; then
+        IGNOREIP=$(grep '^ignoreip' "$CONF")
+        if ! echo "$IGNOREIP" | grep -q "$NETADDR"; then
+            echo "CN: Enabling local IP ranges exclusion..."
+            cp_check_and_sed '^ignoreip' \
+                "s;^\(ignoreip.*\)$;\1 $NETADDR;g" "$CONF" || true
+        fi
+    elif grep -q '^#ignoreip' "$CONF"; then
+        echo "CN: Enabling local IP ranges exclusion..."
+        cp_check_and_sed '^#ignoreip' \
+            "s;^#ignoreip.*$;ignoreip = $NETADDR;g" "$CONF" || true
+   fi
 fi
 
 # restart the services