#! /bin/sh
# /etc/init.d/xorg
#
# chkconfig: 2345 52 78
# description: Genererate X configuration at boot time
# $Id$

set -e

GENERATE_XCFG_AT_BOOT=

if [ -f /etc/default/xorg ] ; then
    . /etc/default/xorg
fi

do_start() {
    if [ true = "$GENERATE_XCFG_AT_BOOT" ] && [ -e /etc/X11/xorg.conf ] ; then
        logger -p user.info -t xorg "Generating new X config file."
        echo "Generating X.org config file."

	# We very likely need sudo for this. If I can get confirmation from a
	# liveCD maker, I'll add it or whatever is needed.
	dpkg-reconfigure -phigh xserver-xorg
    fi
}

case "$1" in
    start)
        do_start
        ;;
    stop|restart|force-reload|status)
        ;;
    *)
        echo $"Usage: $0 {start|stop|restart|force-reload|status}"
        exit 2
        ;;
esac
exit 0

