#!/bin/sh
# Deregister a login. (Derived from TakeConsole as follows:)
#

if [ `w -h $USER | wc -l` -lt 1 ] ; then
    esd_id=`ps axuw | grep esd | grep $USER | grep -v grep | gawk '{print $2}' `
    if [ "$esd_id.x" != ".x" ]; then
        kill $esd_id
    fi
fi

/usr/X11R7/bin/sessreg -d -w "/var/log/wtmp" -u "/var/run/utmp" 	-x "XDMCONFIGDIR/Xservers" -l $DISPLAY -h "" $USER
