Subversion Repositories ALCASAR

Rev

Details | Last modification | View Log

Rev Author Line No. Line
1 root 1
#!/bin/sh
2
#
3
# Startup script for dansguardian
4
#
5
# chkconfig: 345 92 8
6
# description: A web content filtering plugin for web \
7
#              proxies, developed to filter using lists of \
8
#              banned phrases, MIME types, filename \
9
#              extensions and PICS labelling.
10
# processname: dansguardian
11
# pidfile: /var/run/dansguardian.pid
12
# config: /etc/dansguardian/dansguardian.conf
13
 
14
### BEGIN INIT INFO
15
# Provides: dansguardian
16
# Required-Start: $network
17
# Required-Stop: $network
18
# Should-Start: $named 
19
# Should-Stop: $named 
20
# Default-Start: 3 4 5
21
# Short-Description: Starts the dansguardian daemon
22
# Description: A web content filtering plugin for web \
23
#              proxies, developed to filter using lists of \
24
#              banned phrases, MIME types, filename \
25
#              extensions and PICS labelling.
26
### END INIT INFO
27
 
28
# Source function library.
29
. /etc/rc.d/init.d/functions
30
 
31
# Source networking configuration.
32
. /etc/sysconfig/network
33
 
34
# Check that networking is up.
35
[ ${NETWORKING} = "no" ] && exit 0
36
 
37
RETVAL=0
38
 
39
start() {
40
	gprintf "Starting dansguardian: "
41
	daemon dansguardian
42
	RETVAL=$?
43
	echo
44
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dansguardian
45
	return $RETVAL
46
}
47
 
48
stop() {
49
	gprintf "Shutting down dansguardian: "
50
	killproc dansguardian
51
	if [ ! -z "`pidof dansguardian`" ]; then
52
	    echo
53
	    gprintf "Giving dansguardian more time to exit: "
54
	    while [ ! -z "`pidof dansguardian`" ]; do echo -n "."; sleep 1; done && success || failure
55
	fi
56
	echo
57
        RETVAL=$?
58
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dansguardian /var/run/dansguardian/dansguardian.pid \
59
	/var/lib/dansguardian/.dguardianipc /var/lib/dansguardian/.dguardianurlipc \
60
	/var/lib/dansguardian/.dguardianipipc
61
	return $RETVAL
62
}
63
 
64
restart() {
65
	stop
66
	start
67
}
68
 
69
reload() {
70
        gprintf "Reloading dansguardian: "
71
        killproc dansguardian -HUP
72
        RETVAL=$?
73
        echo
74
        return $RETVAL
75
}
76
 
77
case "$1" in
78
  start)
79
	start
80
	;;
81
  stop)
82
	stop
83
	;;
84
  restart)
85
	restart
86
	;;
87
  reload)
88
	reload
89
	;;
90
  condrestart)
91
	[ -e /var/lock/subsys/dansguardian ] && restart
92
	RETVAL=$?
93
	;;
94
  status)
95
	status dansguardian
96
	RETVAL=$?
97
	;;
98
  *)
99
	gprintf "Usage: %s {start|stop|restart|reload|condrestart|status}\n" "$0"
100
	RETVAL=1
101
esac
102
 
103
exit $RETVAL