Skip to content

Instantly share code, notes, and snippets.

Created January 8, 2009 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/44675 to your computer and use it in GitHub Desktop.
Save anonymous/44675 to your computer and use it in GitHub Desktop.
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