Skip to content

Instantly share code, notes, and snippets.

Created March 15, 2012 11:14
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Sblam Updater
#!/usr/bin/env bash
# Autoupdater for SBLAM! blacklist and converter to nginx deny format
# Based on by Marcin M. (exine):
BLACKLIST="" # Adress of the source blacklist
HTACCESS="/usr/local/www/apache22/data/.htaccess" # Under this path blacklist will be saved. Do NOT set this to any file that needs to contain something else than blacklist, it is cleared every time this script runs
DATE=`date` # Do not change unless you know what you're doing
chmod 0600 ${TMP_BLACKLIST} # /tmp race prevention
/usr/local/bin/wget -O- ${BLACKLIST} > ${TMP_BLACKLIST}
echo "# This file is updated periodically, do not edit" > ${HTACCESS}
echo "# Last update: ${DATE}" >> ${HTACCESS}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment