#!/bin/sh
# /etc/init.d/xfs: start or stop the X font server

set -e

PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/bin/X11/xfs
PIDFILE=/var/run/xfs.pid

test -x $DAEMON || exit 0

case "$1" in
  start)
    echo -n "Starting X font sever: xfs"
    start-stop-daemon --start --quiet --pid $PIDFILE --exec $DAEMON || echo -n " already running"
    echo "."
  ;;

  restart)
    /etc/init.d/xfs stop
    /etc/init.d/xfs start
  ;;

  reload)
    echo -n "Reloading X font server configuration..."
    start-stop-daemon --stop --signal 1 --quiet --pid $PIDFILE || echo "xfs not running."
    echo "done."
  ;;

  force-reload)
    /etc/init.d/xfs reload
  ;;

  stop)
    echo -n "Stopping X font server: xfs"
    start-stop-daemon --stop --quiet --pid $PIDFILE || echo -n " not running"
    echo "."
  ;;

  *)
    echo "Usage: /etc/init.d/xfs {start|stop|restart|reload|force-reload}"
    exit 1
    ;;
esac

exit 0
