diff options
author | Dirk Meyer <dinoex@FreeBSD.org> | 2003-10-03 13:31:26 +0000 |
---|---|---|
committer | Dirk Meyer <dinoex@FreeBSD.org> | 2003-10-03 13:31:26 +0000 |
commit | 8ebd5b645a36ea105a19011b515da8d8bcba85f6 (patch) | |
tree | 9f038e817bdfcf6b8220d881d797257ddb3fa75e /security/clamav-devel/files/clamav-clamd.sh | |
parent | a03d2350c75527aa650de4d0504a037a5a8f1105 (diff) | |
download | ports-8ebd5b645a36ea105a19011b515da8d8bcba85f6.tar.gz ports-8ebd5b645a36ea105a19011b515da8d8bcba85f6.zip |
- Upgrade to 20031001
- added RC-ng scripts
- Fix build on CURENT
PR: 57451
Submitted by: rob@debank.tv, eikemeier@fillmore-labs.com, dinoex
Notes
Notes:
svn path=/head/; revision=90126
Diffstat (limited to 'security/clamav-devel/files/clamav-clamd.sh')
-rw-r--r-- | security/clamav-devel/files/clamav-clamd.sh | 69 |
1 files changed, 52 insertions, 17 deletions
diff --git a/security/clamav-devel/files/clamav-clamd.sh b/security/clamav-devel/files/clamav-clamd.sh index e0ea51c02d01..add634772cea 100644 --- a/security/clamav-devel/files/clamav-clamd.sh +++ b/security/clamav-devel/files/clamav-clamd.sh @@ -1,18 +1,53 @@ #!/bin/sh -PREFIX=%%PREFIX%% - -case "$1" in -start) - # remove old socket - rm -f /tmp/clamd - [ -x ${PREFIX}/sbin/clamd ] && ${PREFIX}/sbin/clamd > /dev/null && echo -n ' clamd' - ;; -stop) - killall 'clamd' && echo -n ' clamd' - ;; -*) - echo "Usage: ${0##*/} { start | stop }" >&2 - ;; -esac - -exit 0 +# +# $FreeBSD$ +# + +# PROVIDE: clamd +# REQUIRE: LOGIN +# BEFORE: mail +# KEYWORD: FreeBSD shutdown + +# +# Add the following lines to /etc/rc.conf to enable clamd: +# +#clamav_clamd_enable="YES" +# +# See clamd(8) for flags +# + +. %%RC_SUBR%% + +name=clamav_clamd +rcvar=`set_rcvar` + +command=%%PREFIX%%/sbin/clamd +pidfile=/var/run/clamav/clamd.pid +required_dirs=%%DATADIR%% +required_files=%%PREFIX%%/etc/clamav.conf + +start_precmd=start_precmd + +start_precmd() +{ + if [ -S "$clamd_socket" ]; then + warn "Stale socket $clamd_socket removed." + rm "$clamd_socket" + fi +} + +stop_postcmd=stop_postcmd + +stop_postcmd() +{ + rm -f $pidfile +} + +# set defaults + +clamav_clamd_enable=${clamav_clamd_enable:-"NO"} +clamav_clamd_flags=${clamav_clamd_flags:-""} +clamav_clamd_socket=${clamav_clamd_socket:-"%%CLAMAV_CLAMD_SOCKET%%"} + +load_rc_config $name +run_rc_command "$1" |