#! /bin/sh #---------------------------------------------------------------------------- # squid-build-squidguard-db - build squidGuards databases # # Copyright (c) 2001-2022 Ansgar Püster # # Creation: 16.11.2003 ap # Last Update: $Id$ # # This program 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. #---------------------------------------------------------------------------- # include eislib . /var/install/include/eislib squid_config=/etc/config.d/squid squidguardconfig=/usr/squidGuard/squidGuard.conf . $squid_config clrhome mecho mecho # stop doing anything if SQUID_MANUAL_CONFIGURATION is set to 'yes' if [ "$SQUID_MANUAL_CONFIGURATION" = 'yes' ] then mecho --warn "Attention: SQUID_MANUAL_CONFIGURATION='yes' squid configuration will not be changed" exit 0 fi if [ $SQUID_INSTALL_SQUIDGUARD = 'no' ]; then mecho -error "SQUID_INSTALL_SQUIDGUARD is set to 'no'" mecho -error "squidGuard databases can't be built'" else if [ ! -f $squidguardconfig ]; then mecho -error "squidGuard configuration file '$squidguardconfig' does not exist." mecho -error "Rebuild squid and squidGuard configuration." mecho -error "Check for error messages." else mecho -info "Building squidGuard databases ..." /usr/bin/squidGuard -C all -c $squidguardconfig 2>&1 rc=$? if [ $rc != 0 ]; then mecho -error "built failed (rc=$rc)" else mecho -info "built complete" mecho mecho mecho -info "Changing access rights ..." #find /usr/squidGuard/db -name '*.db' -print -exec chown squid:squid {} \; find /usr/squidGuard/db -name '*.db' -exec chown squid:squid {} \; mecho -info "done" mecho mecho -std "You have to stop and start squid to use the new databases." mecho fi fi fi anykey