#!/bin/bash

if [ ! -r /etc/sysconfig/xfs ]; then
	echo "unable to read /etc/sysconfig/xfs"
	exit 1
fi

. /etc/sysconfig/xfs

PROGRAM=/usr/X11R6/bin/xfs
RUNLEVEL=5
ARGS="-daemon"
if [ ! -z ${CONFIG} ]; then
	ARGS="-config ${CONFIG} ${ARGS}"
fi
if [ ! -z ${PORTNO} ]; then
	ARGS="-port ${PORTNO} ${ARGS} "
fi
if [ ! -z ${RUN_AS_USER} ]; then
	ARGS="-user ${RUN_AS_USER} -droppriv ${ARGS}"
fi

. /etc/init.d/smgl_init
