#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: allow_hosts
# REQUIRE: named
# KEYWORD: shutdown
#

. /etc/rc.subr

name="allow_hosts"
desc="Allow hosts by DNS (from local DNS)"

start_cmd='allow_hosts_start'
stop_cmd='allow_hosts_stop'
rcvar='allow_hosts_enable'

load_rc_config 'allow_hosts'

[ -z "$allow_hosts_enable" ] && allow_hosts_enable='NO'
if [ -z "${allow_hosts_rules}" ] 
then
    echo "Must have a route policy target file"
    exit 1
fi

. /etc/router-conf/pf-framework.subr



allow_hosts_start()
{
    echo "Running allow hosts"
    echo "include \"${allow_hosts_rules}\"" > /etc/router-conf/gen/pf.rules.conf
    pfctl -a allow-hosts -f ${allow_hosts_rules}
}

allow_hosts_stop()
{
}



################ Epilogue

run_rc_command "$1"

# vim: ft=bash
