#! /bin/sh # Startup script for dansguardian # # description: A web content filtering plugin for web \ # proxies, developed to filter using lists of \ # banned phrases, MIME types, filename \ # extensions and PICS labling. # processname: dansguardian2 # pidfile: /var/run/dansguardian2.pid # config: /etc/dansguardian2/dansguardian.conf CONFFILELOCATION=/etc/dansguardian2/ BINARYLOCATION=/usr/sbin/ PIDDIR=/var/run/ # See how we were called case "$1" in start) if [ -f ${BINARYLOCATION}dansguardian2 ] && [ -f ${CONFFILELOCATION}dansguardian.conf ]; then echo " * Starting dansguardian2..." if ${BINARYLOCATION}dansguardian2 -c /etc/dansguardian2/dansguardian.conf 2> /dev/null; then echo " [ ok ]" touch /var/lock/dansguardian2 else echo " [ FAILED ]" fi fi ;; stop) echo " * Shutting down dansguardian2..." if ${BINARYLOCATION}dansguardian2 -c /etc/dansguardian2/dansguardian.conf -q 2> /dev/null; then echo " [ ok ]" /bin/rm -f ${PIDDIR}dansguardian2.pid /bin/rm -f /tmp/.dguardian2ipc /bin/rm -f /var/lock/dansguardian2 else echo " [ FAILED ]" fi ;; reload|restart) $0 stop sleep 3 $0 start ;; status) if [ -f ${BINARYLOCATION}dansguardian2 ]; then ${BINARYLOCATION}dansguardian2 -c /etc/dansguardian2/dansguardian.conf -s fi ;; *) echo "Usage: {start|stop|restart|status}" >&2 ;; esac exit 0