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