#!/bin/bash RULESET="add table x add set x y { type ipv4_addr; } add element x y { 1.1.1.1, 2.2.2.2 } delete element x y { 1.1.1.1 } delete element x y { 1.1.1.1 }" $NFT -f - <<< "$RULESET" 2> /dev/null || exit 0 # Kernel must return ENOENT echo "E: allowing double-removal of element" exit 1