#!/bin/bash # Copyright (C) 2016 by Mike Gabriel # This script is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This script is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the # Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. set -e unset http_proxy unset https_proxy unset ftp_proxy SHALLA_BLACKLIST_URL="http://www.shallalist.de/Downloads/shallalist.tar.gz" mkdir -p /var/lib/e2guardian/ curl "$SHALLA_BLACKLIST_URL" 1> /var/lib/e2guardian/blacklists.tar.gz 2>/dev/null if [ -e /var/lib/e2guardian/.blacklists.new ]; then rm -Rf /var/lib/e2guardian/.blacklists.new fi mkdir -p /var/lib/e2guardian/.blacklists.new cd /var/lib/e2guardian/.blacklists.new tar xzf /var/lib/e2guardian/blacklists.tar.gz mv BL/* . rmdir BL/ cd - 1>/dev/null if [ -e /var/lib/e2guardian/blacklists.old ]; then rm -Rf /var/lib/e2guardian/blacklists.old fi if [ -d /var/lib/e2guardian/blacklists ]; then mv /var/lib/e2guardian/blacklists /var/lib/e2guardian/blacklists.old fi if [ ! -e /var/lib/e2guardian/blacklists ]; then mv /var/lib/e2guardian/.blacklists.new /var/lib/e2guardian/blacklists LANG=C date 1> /var/lib/e2guardian/last-updated.txt chown root:root -Rf /var/lib/e2guardian/blacklists chmod -Rf a+r /var/lib/e2guardian/blacklists cd /var/lib/e2guardian/blacklists find * -type d | while read dir; do chmod a+x "${dir}" done cd - 1> /dev/null invoke-rc.d e2guardian restart 1>/dev/null 2>/dev/null fi if [ -e /var/lib/e2guardian/blacklists.tar.gz ]; then rm -f /var/lib/e2guardian/blacklists.tar.gz fi