mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-29 13:00:32 +01:00
51 lines
866 B
Bash
51 lines
866 B
Bash
#!/bin/sh
|
|
#
|
|
# /etc/rc.d/rc.clamsmtpd
|
|
#
|
|
# start/stop/restart clamsmtp mail filter daemon
|
|
#
|
|
# To make ntpd start automatically at boot, make this
|
|
# file executable: chmod 755 /etc/rc.d/rc.clamsmtpd
|
|
# to edit the startup options refer man 8 clamsmtpd
|
|
#
|
|
|
|
CONFIG="/etc/clamsmtpd.conf"
|
|
PIDFILE="/var/run/clamav/clamsmtpd.pid"
|
|
|
|
clamsmtpd_start() {
|
|
echo "Starting clamsmtp daemon"
|
|
/usr/sbin/clamsmtpd -f $CONFIG -p $PIDFILE
|
|
}
|
|
|
|
clamsmtpd_stop() {
|
|
if [ -f $PIDFILE ]; then
|
|
echo "Stopping clamsmtp daemon"
|
|
/bin/kill $(cat $PIDFILE) 2> /dev/null
|
|
else
|
|
echo "/usr/sbin/clamsmtpd doesn't seem to be running...exiting"
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
clamsmtpd_restart() {
|
|
clamsmtpd_stop
|
|
sleep 5
|
|
clamsmtpd_start
|
|
}
|
|
|
|
case "$1" in
|
|
'start')
|
|
clamsmtpd_start
|
|
;;
|
|
'stop')
|
|
clamsmtpd_stop
|
|
;;
|
|
'restart')
|
|
clamsmtpd_restart
|
|
;;
|
|
'*')
|
|
echo "USAGE: $0 start|stop|restart"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|