#!/bin/sh 
#
# Originally based on: gdm /etc/init.d script on debian
#
# THIS DOESN'T WORK YET atmos - May 6, 2002
# THIS DOES WORK! atmos - May 27, 2002
# THIS WORKS WITH LSB! azundris - May 23, 2004

# /etc/init.d/entrance
#
### BEGIN INIT INFO
# Provides:          entrance
# Required-Start:    $remote_fs
# X-UnitedLinux-Should-Start: ypbind hwscan $syslog gpm
# Required-Stop:
# Default-Start:     5
# Default-Stop:
# Description:       X Display Manager
### END INIT INFO

set -e

# HEED_DEFAULT_DISPLAY_MANAGER to "false."
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
DAEMON=/usr/local/sbin/entranced
PIDFILE=/var/run/entranced.pid

test -x $DAEMON || exit 0

case "$1" in
  start)
	echo -n "Becoming entranced: entrance"
	$DAEMON
	echo "."
  ;;
  stop)
	echo -n "Stopping Entrance: entrance"
	kill -9 `cat $PIDFILE` 
	echo "."
  ;;
  restart)
	$0 stop
	$0 start
  ;;
  *)
	echo "Usage: $0 {start|stop|restart}"
	exit 1
  ;;
esac

exit 0

