#!/bin/sh

RUNLEVEL="`grep ^id: /etc/inittab | cut -d':' -f2`"

if [ "$RUNLEVEL" -eq "3" ]
then

	FILE=/etc/inittab
	if [ -f $FILE ]
	then
		perl -i.ltsp -p -e "s,x:5:respawn:/etc/X11/prefdm -nodaemon,x:35:respawn:/etc/X11/prefdm -nodaemon,"  $FILE
	fi

	FILE=/etc/X11/gdm/gdm.conf
	if [ -f $FILE ]
	then
		perl -i.ltsp -p -e "s,0=/usr/bin/X11/X,#0=/usr/bin/X11/X,"  $FILE
	fi

	FILE=/etc/X11/xdm/Xservers
	if [ -f $FILE ]
	then
		perl -i.ltsp -p -e "s,:0 local /usr/X11R6/bin/X,#:0 local /usr/X11R6/bin/X,"  $FILE
	fi

fi
