source: trunk/packs/dotfiles/bash_login @ 19883

Revision 19883, 4.2 KB checked in by rbasch, 21 years ago (diff)
Run mailquota to check usage on post office server.
Line 
1# Prototype global .bash_login file
2# $Id: bash_login,v 1.9 2003-10-14 15:47:40 rbasch Exp $
3
4# This file is sourced by default user file ~/.bash_login
5
6. ~/.bashrc
7
8# SGI xwsh runs shells as login shells. We don't want this.
9if [ "${XSESSION+set}" = set ]; then
10        exit 0
11fi
12
13initdir=/usr/athena/lib/init
14
15# Remember the pid of the login shell; used by dustbuster.
16ATHENA_LOGIN_SESSION=$$
17export ATHENA_LOGIN_SESSION
18
19# Create a unique temporary directory for the session, and remember
20# the directory name in the environment.
21sessiondir="`$initdir/mksessiondir -s $$`"
22if [ -n "$sessiondir" ]; then
23  ATHENA_SESSION_TMPDIR="$sessiondir"
24  export ATHENA_SESSION_TMPDIR
25fi
26
27if [ ! -r ~/.hushlogin ]; then
28        verbose_login=t         # Echo messages unless user has ~/.hushlogin.
29fi
30
31/bin/stty sane                  # Use sane control characters
32
33if [ sgi = "$HOSTTYPE" ]; then
34        /bin/stty intr ^C
35fi
36
37# *******************   ENVIRONMENT SETUP   *******************
38
39# The ~/.bashrc file sets environment variables, attaches lockers, and sets
40# the command search path.  It has already been sourced at this point.
41
42# Check that user home directory is available
43
44if [ "${TMPHOME+set}" = set ]; then
45        echo "WARNING:"
46        echo ""
47        echo "Your home directory is currently unavailable."
48        echo "This is probably due to a problem with the"
49        echo "fileserver on which your directory is stored."
50        echo ""
51        echo "You may use a temporary directory for this session."
52        echo "If you do, any files you create and any mail you"
53        echo "incorporate will be DELETED when you logout and lost forever."
54        echo ""
55        echo "Would you like to continue this session, using a TEMPORARY"
56        echo -n "directory? (yes,no) [The default is no] "
57        read answer
58        case $answer in
59        [yY]*)
60                echo "Continuing with temporary directory..."
61                mkdir ~/Mail
62                ;;
63        *)
64                kill -HUP $$
65                ;;
66        esac
67fi
68       
69
70# *******************   DEVICE SETUP   *******************
71
72# On IRIX, the terminal type may not be set yet.
73if [ "${TERM+set}" != set ]; then
74        eval `tset -s -Q`
75fi
76
77# Set device type if interactive session (e.g., dialup)
78
79case $TERM in
80switch|network|dialup|unknown)
81        # The standard terminal emulation is vt100.  To use a different
82        # emulation, set the environmental variable DEF_TERM in your
83        # ~/.bash_environment file to to the device you want to emulate
84        # (one that the system will recognize).
85        export DEF_TERM
86        if [ "${DEF_TERM+set}" != set ]; then DEF_TERM=vt100; fi
87        set -f; eval `tset -s -I -Q "?${DEF_TERM}"`; set +f
88        ;;
89esac
90
91# If the login is on an X display but the DISPLAY variable has not
92# been set, ask the user what the DISPLAY should be (e.g., rlogin)
93
94if [ "${DISPLAY+set}" != set ]; then
95        case $TERM in
96        xterm*)
97                echo -n "What DISPLAY are you using [default: none]? "
98                read response
99                if [ -n "$response" ]; then
100                        export DISPLAY
101                        case $response in
102                        *:*)
103                                echo "Setting DISPLAY to $response"
104                                DISPLAY="$response"
105                                ;;
106                        *)
107                                echo "Setting DISPLAY to ${response}:0"
108                                DISPLAY="${response}:0"
109                                ;;
110                        esac
111                fi
112                ;;
113        esac
114fi
115
116
117# *******************   ACTIVITY STARTUP   *******************
118
119# Run standard system/user startup activities
120
121# Run default system startup activities.  To skip these, put the command
122# "set skip_tty_startup" in your ~/.bash_environment file.
123
124if [ "${ZEPHYR_CLIENT+set}" != set ]; then
125        export ZEPHYR_CLIENT
126        ZEPHYR_CLIENT=zwgc
127fi
128
129if [ "${skip_tty_startup+set}" != set ]; then
130        if [ "${verbose_login+set}" = set ]; then
131                 echo "Running standard startup activities ..."
132        fi
133        IGNOREEOF=                      # ^D won't log you out
134        $ZEPHYR_CLIENT                  # Start Zephyr client
135        get_message -login              # Display current motd
136        mailquota -n                    # Check quota on post office server
137        from -t -n                      # Check for mail
138        (olc who &) > /dev/null 2>&1    # Ping the OLC server
139fi
140
141
142# Run the tty-session customizing commands in your ~/.startup.tty file.
143
144if [ -r ~/.startup.tty ]; then
145        # Don't echo if noninteractive
146        if [ "${verbose_login+set}" = set ]; then
147                echo "Running custom startup activities listed in ~/.startup.tty ..."
148        fi
149        . ~/.startup.tty
150fi
151
152
153# Run notification system, lert. To skip this (a generally bad idea unless
154# you plan to run it yourself), put the commend "set skip_lert" in your
155# ~/.bash_environment file.
156
157if [ "${skip_lert+set}" != set ]; then
158        lert -q                         # Don't want to see server errors.
159fi
Note: See TracBrowser for help on using the repository browser.