#!/bin/sh
#
# chkconfig: 345 95 05
#
# description: A X11 fontserver for TrueType fonts.
#
# pidfile: /var/run/xfstt.pid
# processname: xfstt


XFSTT=/usr/X11R6/bin/xfstt
CACHE=/var/cache/xfstt
TTFONTS=/usr/share/fonts/truetype
PORT=7101
USER=nobody

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

# See how we were called.
case "$1" in
  start)
	# Start daemons.
	echo -n "Starting xfstt: "
	$XFSTT --cache $CACHE --dir $TTFONTS --sync > /dev/null 2>&1
	daemon $XFSTT --port $PORT --user $USER --dir $TTFONTS --cache $CACHE --daemon
	echo
	touch /var/lock/subsys/xfstt
	;;
  stop)
	# Stop daemons.
	echo -n "Shutting down xfstt: "
	killproc $XFSTT
	echo
	rm -f /var/lock/subsys/xfstt
	;;
  restart)
	$0 stop
	$0 start
	;;
  status)
	status xfstt
	;;
  *)
	echo "Usage: $0 {start|stop|restart|status}"
	exit 1
esac

exit 0
