#! /bin/sh # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): # wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return Florent Thoumie # ---------------------------------------------------------------------------- sed="/usr/bin/sed" pfctl="/sbin/pfctl" cpp="/usr/bin/cpp" confdir="/etc/pf.conf.d" _list="$*" _config=${_list##*-f\ } _config=${_config%%\ *} if [ -z "${_config}" -o "${_config##-}" != "${_config}" ]; then exec ${pfctl} ${_list} else _list=`echo ${_list} | sed "s|-f ${_config}|-f -|"` exec ${sed} 's/#.*//;s/^include \(.*\)/#include <\1>/' ${_config} | ${cpp} -P -x c -E -I${confdir} - | ${pfctl} ${_list} fi