From: Heiko Z. <smi...@us...> - 2009-09-11 15:27:24
|
Update of /cvsroot/devil-linux/build/scripts/scripts In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv23794/scripts/scripts Added Files: dansguardian Log Message: - updated MailScanner-4.77.10-1 - addedd ajaxterm for webmin - updated alsa-lib-1.0.21a - updated cpio-2.10 - updated cpqarrayd-2.3 - updated ctags-5.8 - updated curl-7.19.6 - updated cutter-1.03 - updated cyrus-imapd-2.3.15 - updated dansguardian-2.10.1.1 - updated dbus-1.2.16 - updated dcc-1.3.115 - updated dkim-milter-2.8.3 - updated fetchmail-6.3.11 - updated findutils-4.2.33 - updated gifsicle-1.55 - updated heimdal-1.2.1 - updated httpd-2.2.13 - updated jftpgw-0.13.5 - updated lftp-3.7.15 - updated libprngwrap-1.0.2 - updated lsof_4.82 - updated lynx2.8.7 - updated mcrypt-2.6.8 - updated memcached-1.2.8 - updated mysql-5.1.38 - updated openldap-2.4.18 - updated openvpn-2.1_rc19 - updated openvpn-2.5 webmin module - updated postgresql-8.3.8 - updated samba-3.4.1 - updated xfsprogs-3.0.3 --- NEW FILE: dansguardian --- #!/bin/sh # # Startup script for dansguardian # # chkconfig: 35 92 8 # description: A web content filtering plugin for web \ # proxies, developed to filter using lists of \ # banned phrases, MIME types, filename \ # extensions and PICS labelling. # processname: dansguardian # pidfile: /var/run/dansguardian.pid # config: /etc/dansguardian/dansguardian.conf ### BEGIN INIT INFO # Provides: dansguardian # Required-Start: squid # Should-Start: # Required-Stop: squid # Should-Stop: # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: Dansguardian web content filter # Description: Dansguardian web content filter ### END INIT INFO # settings source /etc/sysconfig/config # parameters CONFIGNAME=DANSGUARDIAN # source function library source /etc/init.d/functions eval START=\$START_$CONFIGNAME # Determine the base and follow a runlevel link name. base=${0##*/} link=${base#*[SK][0-9][0-9]} # Force execution if not called by a runlevel directory. test $link = $base && START=yes test "$START" = "yes" || exit 0 # File includes changes by Thomas Jarosch function wait_for_pid() { local PID=$1 local RET=0 if [ $PID -eq 0 ] ; then return $RET fi # give 60 secs then KILL local COUNTDOWN=60 while [ -d /proc/${PID} ] && [ $COUNTDOWN -gt 0 ] ; do sleep 1 COUNTDOWN=$[$COUNTDOWN-1] done if [ -d /proc/${PID} ]; then COMMAND=`ps h -o command ${PID}` logger "dansguardian: timeout waiting for PID ${PID}: ${COMMAND}; sending SIGKILL" kill -KILL $PID >/dev/null 2>&1 RET=1 fi return $RET } # See how we were called. case "$1" in start) if [ -f /usr/sbin/dansguardian ] && [ -f /etc/dansguardian/dansguardian.conf ]; then echo -n "Starting dansguardian: " if /usr/sbin/dansguardian 2> /dev/null; then echo -e "\\033[60G\c" echo -e "[ \\033[1;32m\c" echo -e "OK\c" echo -e "\\033[0;39m\c" echo " ]" [ -d /var/lock/subsys ] && touch /var/lock/subsys/dansguardian else echo -e "\\033[60G\c" echo -e "[ \\033[1;31m\c" echo -e "FAILED\c" echo -e "\\033[0;39m\c" echo " ]" fi fi ;; stop) echo -n "Shutting down dansguardian: " WAITPID=0 if [ -f /var/run/dansguardian.pid ] ; then WAITPID=`cat /var/run/dansguardian.pid` fi if /usr/sbin/dansguardian -q 2> /dev/null; then if wait_for_pid $WAITPID ; then echo -e "\\033[60G\c" echo -e "[ \\033[1;32m\c" echo -e "OK\c" echo -e "\\033[0;39m\c" echo " ]" else echo -e "\\033[60G\c" echo -e "[ \\033[1;31m\c" echo -e "FAILED\c" echo -e "\\033[0;39m\c" echo " ]" fi /bin/rm -f /var/run/dansguardian.pid /bin/rm -f /tmp/.dguardianipc [ -d /var/lock/subsys ] && /bin/rm -f /var/lock/subsys/dansguardian else echo -e "\\033[60G\c" echo -e "[ \\033[1;31m\c" echo -e "FAILED\c" echo -e "\\033[0;39m\c" echo " ]" fi ;; restart) $0 stop $0 start ;; status) if [ -f /usr/sbin/dansguardian ]; then /usr/sbin/dansguardian -s fi ;; *) echo "Usage: $0 {start|stop|restart|status}" >&2 ;; esac exit 0 |