#! /bin/sh
#
# skeleton      Example file to build /etc/init.d scripts.
#
# Version:      @(#) /etc/init.d/mcserv  09-Apr-1997
#
# Author:       Tomasz Kłoczko, <kloczek@rudy.mif.pg.gda.pl>
#               Michele Marziani <marziani@fe.infn.it>
#
# chkconfig: - 86 30
# description: The Midnight Commander server allows users on remote machines \
#	       to use the Midnight Commander file manager to manipulate their \
#	       files on the machine running the server. The server  \
#              authenticates the user through PAM, which by default requires \
#              a username/password combination before allowing access.
# processname: mcserv

# Source function library.
. /etc/rc.d/init.d/functions

RETVAL=0

# See how we were called.
case "$1" in
  start)
        echo -n "Starting mcserv services: "
	daemon /usr/bin/mcserv -d
	RETVAL=$?
	touch /var/lock/subsys/mcserv
	echo
	;;
  status)
        status mcserv
	;;
  restart|reload)
        $0 stop
	$0 start
        ;;
  stop)
        echo -n "Shutting down mcserv services: "
	killproc mcserv
	RETVAL=$?
	rm -f /var/lock/subsys/mcserv
	echo
	;;
  *)
	echo "Usage: mcserv.init {start|stop|status|restart|reload}"
	exit 1
esac

exit $RETVAL

