Dtlogin logo for FreeBSD
[oweals/cde.git] / cde / programs / dtlogin / config / Xreset.src
1 XCOMM! KORNSHELL
2 XCOMM ##########################################################################
3 XCOMM
4 XCOMM   Xreset
5 XCOMM
6 XCOMM   Common Desktop Environment (CDE)
7 XCOMM
8 XCOMM   Configuration file for the Login Manager
9 XCOMM
10 XCOMM   (c) Copyright 1993, 1994 Hewlett-Packard Company
11 XCOMM   (c) Copyright 1993, 1994 International Business Machines Corp.
12 XCOMM   (c) Copyright 1993, 1994 Sun Microsystems, Inc.
13 XCOMM   (c) Copyright 1993, 1994 Novell, Inc.
14 XCOMM
15 XCOMM       ************** DO NOT EDIT THIS FILE **************
16 XCOMM
17 XCOMM   CDE_INSTALLATION_TOP/config/Xreset is a factory-default file and will
18 XCOMM   be unconditionally overwritten upon subsequent installation.
19 XCOMM   Before making changes to the file, copy it to the configuration 
20 XCOMM   directory, CDE_CONFIGURATION_TOP/config. You must also update the reset
21 XCOMM   resource in CDE_CONFIGURATION_TOP/config/Xconfig.
22 XCOMM
23 XCOMM   $XConsortium: Xreset.src /main/6 1996/08/15 16:51:53 rswiston $
24 XCOMM
25 XCOMM
26 XCOMM   This file is symmetrical with Xstartup. This script is run after the user
27 XCOMM   session is terminated. Run as root, it should probably contain commands 
28 XCOMM   that undo the effects of commands in Xstartup, such as unmounting directories
29 XCOMM   from file servers. The collection of environment variables that were passed
30 XCOMM   to Xstartup are also passed to Xreset.
31 XCOMM
32 XCOMM ##########################################################################
33
34 XCOMM
35 XCOMM This script is run as root after the session terminates but
36 XCOMM before the display is closed...
37 XCOMM
38
39 XCOMM
40 XCOMM  Update action types for any printers created during the session  
41 XCOMM
42
43 if [ -x /usr/dt/bin/dtprintinfo ] 
44 then
45    /usr/dt/bin/dtprintinfo -populate
46 fi
47
48 XCOMM
49 XCOMM  Reset console ownership if local session
50 XCOMM
51
52 if [ "$DTXSERVERLOCATION" = "local" ]
53 then
54   if [[ ! -z "$ITE" && "$ITE" != "??" && -a "/dev/$ITE" ]]
55   then
56         chown root /dev/$ITE
57         chgrp $ROOT_GID  /dev/$ITE
58   fi
59 fi
60
61 XCOMM
62 XCOMM If Xsession did not exit gracefully for this user, the dtdbcache
63 XCOMM file will still be left around.  Remove it if this user owns it.
64 XCOMM
65
66 XCOMM dtdbcache file's directory should match
67 XCOMM _DTDTSMMTEMPDIR in DtSvc/DtUtil1/DtsMM.h
68 #ifdef __osf__
69 DTDBFILE=/var/tmp/dtdbcache_$DISPLAY
70 #else
71 DTDBFILE=/tmp/dtdbcache_$DISPLAY
72 #endif
73 if [ -f $DTDBFILE ]
74 then
75   DTDBFILEOWNER=`/bin/ls -l $DTDBFILE | /bin/awk '{print $3}'`
76   if [ $USER = $DTDBFILEOWNER ]
77   then
78     /bin/rm -f $DTDBFILE
79   fi
80 fi