#!/bin/bash # # chkconfig: 2345 65 35 # description: POPFile is an email classification tool \ # with a Naive Bayes classifier, a POP3 proxy and a web \ # interface. # probe: false # processname: popfile # pidfile: /var/run/popfile.pid # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ "${NETWORKING}" = "no" ] && exit 0 [ -f /usr/share/popfile/popfile.pl ] || exit 0 # See how we were called. case "$1" in start) gprintf "Starting POPFile: " cd /usr/share/popfile /usr/bin/perl ./popfile.pl >> /var/log/popfile.log & success; echo touch /var/lock/subsys/popfile ;; stop) gprintf "Stopping POPFile: " kill `pidof perl ./popfile.pl` success; echo rm -f /var/lock/subsys/popfile ;; status) status popfile ;; restart|reload) $0 stop $0 start ;; condrestart) [ -f /var/lock/subsys/popfile ] && restart ;; *) gprintf "Usage: popfile {start|stop|status|restart|condrestart|reload}\n" exit 1 esac exit 0