Skip to content

Instantly share code, notes, and snippets.

/gist:44675
Created Jan 8, 2009

Embed
What would you like to do?
BLACKLIST_DIR=/etc/blacklists
BLACKLIST_SOURCES:=$(shell [ -d ${BLACKLIST_DIR} ] && cd ${BLACKLIST_DIR} && ls | grep -v '.new$$')
LOCAL_BLACKLIST:=$(wildcard blacklist.d/local.inc)
BLACKLIST_OBJECTS=$(BLACKLIST_SOURCES:%=blacklist.d/%)
reload: ${INCLUDE_DIR} ${BLACKLIST_OBJECTS} ${LOCAL_BLACKLIST} policy.inc ferm.conf
@/etc/init.d/ferm reload
blacklist.d/%: ${BLACKLIST_DIR}/%
@echo Rebuilding "'$@'" from "'$<'"
@sed -ne 's,^\([0-9:./][0-9:./]*\), saddr \1 DROP;,p' < $< > $@
${INCLUDE_DIR}:
@mkdir -p blacklist.d
.PHONY: reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.