From 25004d7f65cc5d8f80bbb02a9c1e2d1cdaf6aa25 Mon Sep 17 00:00:00 2001 From: Ivan Rako Date: Sun, 27 Dec 2020 23:04:16 +0100 Subject: [PATCH] Izmjene za buster. --- debian/postinst | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/debian/postinst b/debian/postinst index 37638c7..3d47138 100755 --- a/debian/postinst +++ b/debian/postinst @@ -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 -- 1.7.10.4