#!/bin/sh
# Written by Jake Vickers () on 8-5-2005
# Lots of hints from were used to write this modified script
# This of course comes with no warranty. It works for me, it may not work for you!
case "$1" in
start)
echo "Starting spamd...."
if svok /var/qmail/supervise/spamd ; then
svc -u /var/qmail/supervise/spamd /var/qmail/supervise/spamd/log
else
echo "supervise for spamd not running!"
fi
echo
sleep 2
svstat /var/qmail/supervise/spamd
svstat /var/qmail/supervise/spamd/log
;;
stop)
echo "Stopping spamd...."
svc -d /var/qmail/supervise/spamd /var/qmail/supervise/spamd/log
sleep 2
echo
svstat /var/qmail/supervise/spamd
svstat /var/qmail/supervise/spamd/log
;;
pause)
echo "Pausing spamd...."
svc -p /var/qmail/supervise/spamd
echo
sleep 2
svstat /var/qmail/supervise/spamd
;;
cont)
echo "Continuing spamd...."
svc -c /var/qmail/supervise/spamd
sleep 2
echo
svstat /var/qmail/supervise/spamd
svstat /var/qmail/supervise/spamd/log
;;
restart)
echo "Restarting spamd...."
svc -d /var/qmail/supervise/spamd /var/qmail/supervise/spamd/log
svc -t /var/qmail/supervise/spamd /var/qmail/supervise/spamd/log
svc -u /var/qmail/supervise/spamd /var/qmail/supervise/spamd/log
sleep 2
echo
svstat /var/qmail/supervise/spamd
svstat /var/qmail/supervise/spamd/log
;;
stat)
svstat /var/qmail/supervise/spamd
svstat /var/qmail/supervise/spamd/log
echo
;;
status)
svstat /var/qmail/supervise/spamd
svstat /var/qmail/supervise/spamd/log
echo
;;
help)
cat < stop -- stops spamd service
start -- starts spamd service
pause -- temporarily stops spamd service
cont -- continues paused spamd service
stat -- displays status of spamd service
restart -- stops and restarts spamd
status -- displays status of spamd service
HELP
;;
*)
echo "Usage: $0 {start|stop|restart|stat|pause|cont|status|help}"
exit 1
;;
esac
exit 0
阅读(994) | 评论(0) | 转发(0) |