File nftables-early-service of Package nftables-service
#!/bin/bash
NFTABLES_CONFIG="/etc/nftables.conf"
NFTABLES_EARLY_CONFIG="/etc/nftables-early.conf"
if [ -e "${NFTABLES_EARLY_CONFIG}" ] ; then
NFTABLES_CONFIG="${NFTABLES_EARLY_CONFIG}"
fi
echo "Interfaces which are set up already: "
/usr/sbin/ip --brief link show
if /usr/sbin/nft --check --file "${NFTABLES_CONFIG}" ; then
echo "Loading '${NFTABLES_CONFIG}'"
/usr/sbin/nft --file "${NFTABLES_CONFIG}"
else
echo "nft --check for '${NFTABLES_CONFIG}' failed. Not loading the config."
exit 1
fi