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. |
---|
9 | if [ "${XSESSION+set}" = set ]; then |
---|
10 | exit 0 |
---|
11 | fi |
---|
12 | |
---|
13 | initdir=/usr/athena/lib/init |
---|
14 | |
---|
15 | if [ ! -r ~/.hushlogin ]; then |
---|
16 | verbose_login=t # Echo messages unless user has ~/.hushlogin. |
---|
17 | fi |
---|
18 | |
---|
19 | /bin/stty sane # Use sane control characters |
---|
20 | |
---|
21 | if [ sgi = "$HOSTTYPE" ]; then |
---|
22 | /bin/stty intr ^C |
---|
23 | fi |
---|
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 | |
---|
32 | if [ "${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 |
---|
55 | fi |
---|
56 | |
---|
57 | |
---|
58 | # ******************* DEVICE SETUP ******************* |
---|
59 | |
---|
60 | # On IRIX, the terminal type may not be set yet. |
---|
61 | if [ "${term+set}" != set ]; then |
---|
62 | eval `tset -s -Q` |
---|
63 | fi |
---|
64 | |
---|
65 | # Set device type if interactive session (e.g., dialup) |
---|
66 | |
---|
67 | case $term in |
---|
68 | switch|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 | ;; |
---|
77 | esac |
---|
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 | |
---|
82 | if [ "${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 |
---|
102 | fi |
---|
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 | |
---|
112 | if [ "${ZEPHYR_CLIENT+set}" != set ]; then |
---|
113 | export ZEPHYR_CLIENT |
---|
114 | ZEPHYR_CLIENT=zwgc |
---|
115 | fi |
---|
116 | |
---|
117 | if [ "${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 |
---|
126 | fi |
---|
127 | |
---|
128 | |
---|
129 | # Run the tty-session customizing commands in your ~/.startup.tty file. |
---|
130 | |
---|
131 | if [ -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 |
---|
137 | fi |
---|
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 | |
---|
144 | if [ "${skip_lert+set}" != set ]; then |
---|
145 | lert -q # Don't want to see server errors. |
---|
146 | fi |
---|