#!/bin/bash set -e RULESET=" table ip t { set s { type ipv4_addr flags interval elements = { 192.168.2.195, 192.168.2.196, 192.168.2.197, 192.168.2.198 } } }" $NFT -f - <<< "$RULESET" $NFT 'delete element t s { 192.168.2.195, 192.168.2.196 }; add element t s { 192.168.2.196 }' 2>/dev/null $NFT get element t s { 192.168.2.196, 192.168.2.197, 192.168.2.198 } 1>/dev/null $NFT 'delete element t s { 192.168.2.196, 192.168.2.197 }; add element t s { 192.168.2.197 }' 2>/dev/null $NFT get element t s { 192.168.2.197, 192.168.2.198 } 1>/dev/null $NFT 'delete element t s { 192.168.2.198, 192.168.2.197 }; add element t s { 192.168.2.196, 192.168.2.197, 192.168.2.195 }' 1>/dev/null $NFT get element t s { 192.168.2.196, 192.168.2.197, 192.168.2.195 } 1>/dev/null $NFT delete element t s { 192.168.2.196, 192.168.2.197, 192.168.2.195 } 2>/dev/null $NFT create element t s { 192.168.2.196} 2>/dev/null $NFT get element t s { 192.168.2.196 } 1>/dev/null