aboutsummaryrefslogblamecommitdiff
path: root/mail/tpop3d/files/tpop3d.sh.sample
blob: 97dbd2514da156681461b4e60b589712c08ab021 (plain) (tree)












































                                                                         
#!/bin/sh
#
# tpop3d:
# Init script for starting/stopping tpop3d.
#
# Copyright (c) 2001 Chris Lightfoot. All rights reserved.
#  Portability enhanced by Chris Elsworth, July 2001
#
# $FreeBSD$
#

if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
    echo "$0: Cannot determine the PREFIX" >&2
    exit 1
fi

DAEMON=$PREFIX/sbin/tpop3d

[ -f $DAEMON ] || exit 0

# See how we were called.
case "$1" in
  start)
        # Start daemons.
        $DAEMON -f $PREFIX/etc/tpop3d.conf -p /var/run/tpop3d.pid \
		&& echo -n " tpop3d"
        ;;
  stop)
        # Stop daemons.
	[ -r /var/run/tpop3d.pid ] && kill `cat /var/run/tpop3d.pid` \
		&& echo -n " tpop3d"
        ;;
  restart)
	$0 stop
	$0 start
	;;
  reload)
  	[ -r /var/run/tpop3d.pid ] && kill -HUP `cat /var/run/tpop3d.pid`
        ;;
  *)
        echo "Usage: `basename $0` {start|stop|restart|reload}"
        exit 1
esac

exit 0