1 | # Prototype global .bash_login file |
---|
2 | # $Id: bash_login,v 1.8 2003-02-19 23:55:27 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. |
---|
9 | if [ "${XSESSION+set}" = set ]; then |
---|
10 | exit 0 |
---|
11 | fi |
---|
12 | |
---|
13 | initdir=/usr/athena/lib/init |
---|
14 | |
---|
15 | # Remember the pid of the login shell; used by dustbuster. |
---|
16 | ATHENA_LOGIN_SESSION=$$ |
---|
17 | export ATHENA_LOGIN_SESSION |
---|
18 | |
---|
19 | # Create a unique temporary directory for the session, and remember |
---|
20 | # the directory name in the environment. |
---|
21 | sessiondir="`$initdir/mksessiondir -s $$`" |
---|
22 | if [ -n "$sessiondir" ]; then |
---|
23 | ATHENA_SESSION_TMPDIR="$sessiondir" |
---|
24 | export ATHENA_SESSION_TMPDIR |
---|
25 | fi |
---|
26 | |
---|
27 | if [ ! -r ~/.hushlogin ]; then |
---|
28 | verbose_login=t # Echo messages unless user has ~/.hushlogin. |
---|
29 | fi |
---|
30 | |
---|
31 | /bin/stty sane # Use sane control characters |
---|
32 | |
---|
33 | if [ sgi = "$HOSTTYPE" ]; then |
---|
34 | /bin/stty intr ^C |
---|
35 | fi |
---|
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 | |
---|
44 | if [ "${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 |
---|
67 | fi |
---|
68 | |
---|
69 | |
---|
70 | # ******************* DEVICE SETUP ******************* |
---|
71 | |
---|
72 | # On IRIX, the terminal type may not be set yet. |
---|
73 | if [ "${TERM+set}" != set ]; then |
---|
74 | eval `tset -s -Q` |
---|
75 | fi |
---|
76 | |
---|
77 | # Set device type if interactive session (e.g., dialup) |
---|
78 | |
---|
79 | case $TERM in |
---|
80 | switch|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 | ;; |
---|
89 | esac |
---|
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 | |
---|
94 | if [ "${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 |
---|
114 | fi |
---|
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 | |
---|
124 | if [ "${ZEPHYR_CLIENT+set}" != set ]; then |
---|
125 | export ZEPHYR_CLIENT |
---|
126 | ZEPHYR_CLIENT=zwgc |
---|
127 | fi |
---|
128 | |
---|
129 | if [ "${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 | from -t -n # Check for mail |
---|
137 | (olc who &) > /dev/null 2>&1 # Ping the OLC server |
---|
138 | fi |
---|
139 | |
---|
140 | |
---|
141 | # Run the tty-session customizing commands in your ~/.startup.tty file. |
---|
142 | |
---|
143 | if [ -r ~/.startup.tty ]; then |
---|
144 | # Don't echo if noninteractive |
---|
145 | if [ "${verbose_login+set}" = set ]; then |
---|
146 | echo "Running custom startup activities listed in ~/.startup.tty ..." |
---|
147 | fi |
---|
148 | . ~/.startup.tty |
---|
149 | fi |
---|
150 | |
---|
151 | |
---|
152 | # Run notification system, lert. To skip this (a generally bad idea unless |
---|
153 | # you plan to run it yourself), put the commend "set skip_lert" in your |
---|
154 | # ~/.bash_environment file. |
---|
155 | |
---|
156 | if [ "${skip_lert+set}" != set ]; then |
---|
157 | lert -q # Don't want to see server errors. |
---|
158 | fi |
---|