source: trunk/packs/dotfiles/bash_login @ 17753

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