#! /bin/sh
#
# xterm -- set the machine up as an X terminal
#

. /etc/rc.d/sysconfig

case "$1" in
start)
	need network portmapper

	if [ "$XHOST" ]; then
	    echo "Starting X server"
	    /usr/X11/bin/X -query $XHOST >/dev/null &
	fi
	;;
info)
	echo "X terminal mode${XHOST:+ (on $XHOST)}"
	;;
stop)
	if killall -0 X; then
	    echo "Killing X server"
	    killall -HUP X
	    sleep 1
	    killall X
	fi
	;;
*)
	echo "usage: $0 {start|stop}" ;;
esac
