2
# 2004-01-25, Thomas Lamy <thomas.lamy@in-online.net>
3
# From Magnus Ekdahl's <magnus@debian.org> clamav-freshclam-handledaemon(8)
7
[ -e /var/lib/clamav/interface ] || exit 0
9
INIT=/etc/init.d/clamav-freshclam
10
CLAMAV_CONF_FILE=/etc/clamav/clamd.conf
11
FRESHCLAM_CONF_FILE=/etc/clamav/freshclam.conf
13
INTERNETIFACE=`cat /var/lib/clamav/interface`
15
if grep -q freshclam /proc/*/stat 2>/dev/null; then
21
# $IFACE is set by ifup/down, $PPP_IFACE by pppd
22
[ -n "$PPP_IFACE" ] && IFACE=$PPP_IFACE
24
# This is sloppy - woody's pppd exports variables, while sid's passes them as
25
# arguments and exports them.
27
if [ "$1" = "$IFACE" ]; then # We're called by sid's pppd
28
shift 6 # and we already know the interface
29
fi # Dump the arguments passed.
32
case $(dirname "$0") in
34
# Short circuit and exit early if freshclam is already running
35
[ "$IS_RUNNING" = 'true' ] && exit 0
36
for interface in $INTERNETIFACE; do
37
if [ "$interface" = "$IFACE" ]; then
45
*/if-down.d|*/ip-down.d)
46
# Short circuit and exit early if freshclam is not already running
47
[ "$IS_RUNNING" = 'false' ] && exit 0
48
for interface in $INTERNETIFACE; do
49
if [ "$interface" = "$IFACE" ]; then
67
IFACE="$IFACE" $INIT $FMODE
72
echo "Usage: $0 {start|stop|skip}" >&2