[13196] | 1 | # Prototype global .bash_login file |
---|
[13480] | 2 | # $Id: bash_login,v 1.3 1999-08-10 16:07:11 ghudson Exp $ |
---|
[13196] | 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. |
---|
[13480] | 9 | if [ "${XSESSION+set}" = set ]; then |
---|
[13196] | 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 |
---|
[13242] | 22 | /bin/stty intr ^C |
---|
[13196] | 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 | |
---|
[13480] | 32 | if [ "${TMPHOME+set}" = set ]; then |
---|
[13196] | 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. |
---|
[13242] | 61 | if [ "${term+set}" != set ]; then |
---|
[13196] | 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 |
---|
[13242] | 74 | if [ "${DEF_TERM+set}" != set ]; then DEF_TERM=vt100; fi |
---|
[13480] | 75 | set -f; eval `tset -s -I -Q "?${DEF_TERM}"`; set +f |
---|
[13196] | 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 | |
---|
[13242] | 82 | if [ "${DISPLAY+set}" != set ]; then |
---|
[13196] | 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 | |
---|
[13242] | 112 | if [ "${ZEPHYR_CLIENT+set}" != set ]; then |
---|
[13196] | 113 | export ZEPHYR_CLIENT |
---|
| 114 | ZEPHYR_CLIENT=zwgc |
---|
| 115 | fi |
---|
| 116 | |
---|
[13242] | 117 | if [ "${skip_tty_startup+set}" != set ]; then |
---|
[13480] | 118 | if [ "${verbose_login+set}" = set ]; then |
---|
[13196] | 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 |
---|
[13480] | 125 | (olc who &) > /dev/null 2>&1 # Ping the OLC server |
---|
[13242] | 126 | fi |
---|
[13196] | 127 | |
---|
| 128 | |
---|
| 129 | # Run the tty-session customizing commands in your ~/.startup.tty file. |
---|
| 130 | |
---|
| 131 | if [ -r ~/.startup.tty ]; then |
---|
[13242] | 132 | # Don't echo if noninteractive |
---|
[13480] | 133 | if [ "${verbose_login+set}" = set ]; then |
---|
[13196] | 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 | |
---|
[13242] | 144 | if [ "${skip_lert+set}" != set ]; then |
---|
[13196] | 145 | lert -q # Don't want to see server errors. |
---|
| 146 | fi |
---|