source: trunk/packs/dotfiles/bash_login @ 13480

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