IPTABLES=$(which iptables)
IP6TABLES=$(which ip6tables)
IPSET=$(which ipset)
+TC=$(which tc)
+
+err(){
+ echo "$@" 1>&2
+}
+
+die(){
+ local status=$1
+ shift
+ err "$@"
+ exit ${status}
+}
function decommentcat(){
sed 's/\s*#.*$//;/^\s*$/d' "$@"
function reload_cidr_sets(){
local set_name="$1"
+ shift
# init new temporary sets
echo "updating set '${set_name}'"
- create_set "${set_name}-tmp" hash:net
- create_set "${set_name}6-tmp" hash:net family inet6
+ create_set "${set_name}-tmp" hash:net "$@"
+ create_set "${set_name}6-tmp" hash:net "$@" family inet6
# populate them
for sfx in '' .$(hostname -s)
}
function allow_services(){
- local s proto port
+ local s
for s in "$@"
do
case "${s}" in