File: syslogout

package info (click to toggle)
sysprofile 0.3.10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 316 kB
  • sloc: sh: 376; makefile: 2
file content (44 lines) | stat: -rw-r--r-- 1,127 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# This script first checks for the existence of "$HOME/.nosyslogout"
# and simply quits if it exists.  If it doesn't exist it further checks 
# for the directory "/etc/syslogout.d" which contains all configuraton 
# scripts to execute.  If the latter doesn't exist it just quits without
# any unnecessary complaints.

# Set SYSDEBUG=1 for debugging:
#SYSDEBUG=1
SYSDEBUG=0

# Only run if user doesn't prevent it:

if [ ! -f $HOME/.nosyslogout ]; then

if [ "$SYSDEBUG" = 1 ]; then 
    if [ ! -d /var/tmp/syslogout ]; then
        mkdir -m 1777 /var/tmp/syslogout
        touch /var/tmp/syslogout/$USER
        chmod 600 /var/tmp/syslogout/$USER
    fi
fi

# First run common system wide scripts if no 
# user defined version exists:

    if [ -d /etc/syslogout.d ]; then
	for i in `cd /etc/syslogout.d && echo *.bash` 
    	do
    	    if [ ! -f $HOME/.syslogout.d/$i ]; then
		. /etc/syslogout.d/$i
	    fi
        done
    fi

# Then run any existing user defined scripts:

    if [ -d $HOME/.syslogout.d ]; then
	for i in `cd $HOME/.syslogout.d && echo *.bash` 
    	do
	    . $HOME/.syslogout.d/$i
        done
    fi
fi