当前位置: 首页 > 工具软件 > spam-bot-3000 > 使用案例 >

spam启动脚本

倪振海
2023-12-01

[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

 类似资料: