|
Server Start Files
/etc/init.d/keriomailserver
- #!/bin/sh -e
- # Start or stop Kerio Mailserver
- #
- # Mimosa <mimosz@gmail.com>
- # based on Postfix init.d script
- PATH=/sbin:/bin:/usr/sbin:/usr/bin
- CFGPATH=/opt/kerio/mailserver
- DAEMON=$CFGPATH/mailserver
- NAME="Kerio Mail Server"
- PIDFILE=/var/run/kms.pid
- test -f $DAEMON || exit 0
- test -r $CFGPATH/mailserver.cfg || exit 0
- . /lib/lsb/init-functions
- case "$1" in
- start)
- log_begin_msg "Starting $NAME Agent..."
- if test -x /etc/init.d/sendmail && test -f /etc/init.d/sendmail; then
- /etc/init.d/sendmail stop
- fi
- if test -x /etc/init.d/postfix && test -f /etc/init.d/postfix; then
- /etc/init.d/postfix stop
- fi
- if start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON $CFGPATH; then
- log_end_msg 0
- else
- log_end_msg 1
- fi
- ;;
- stop)
- log_begin_msg "Stopping $NAME Agent..."
- if start-stop-daemon --stop --oknodo --pidfile $PIDFILE; then
- log_end_msg 0
- else
- log_end_msg 1
- fi
- ;;
- restart)
- $0 stop || true
- $0 start
- ;;
- *)
- log_success_msg "Usage: /etc/init.d/keriomailserver {start|stop|restart}"
- exit 1
- ;;
- esac
- exit 0
复制代码 |
|