spam启动脚本

[root@gby /usr/local/bin]# cat /usr/local/sbin/spamctl
#!/bin/sh

# description: the spamassassin daemon

case "$1" in
start)
echo "Starting the spamassassin daemon (spamd)..."
/usr/local/bin/spamd -d -x -u nobody -m 50 /var/run/spamd.pid
;;
stop)
echo "Stopping the spamassassin daemon (spamd)..."
kill `cat /var/run/spamd.pid`
;;
restart)
echo "Restarting the spamassassin daemon (spamd)..."
spamdctl stop
spamdctl start
;;
help)
cat <<HELP
stop -- stops the spamassassin daemon
start -- starts the spamassassin daemon
restart -- stops and restarts spamd
HELP
;;
*)
echo "Usage: $0 {start|stop|restart|help}"
exit 1
;;
esac

exit 0

你可能感兴趣的:(脚本)