[13196] | 1 | # Prototype global .bash_login file |
---|
[22666] | 2 | # $Id: bash_login,v 1.12 2007-08-22 18:11:08 ghudson Exp $ |
---|
[13196] | 3 | |
---|
| 4 | # This file is sourced by default user file ~/.bash_login |
---|
| 5 | |
---|
[21128] | 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. |
---|
[13196] | 9 | . ~/.bashrc |
---|
| 10 | |
---|
[22913] | 11 | initdir=/usr/lib/init |
---|
[13196] | 12 | |
---|
[17541] | 13 | # Remember the pid of the login shell; used by dustbuster. |
---|
| 14 | ATHENA_LOGIN_SESSION=$$ |
---|
| 15 | export ATHENA_LOGIN_SESSION |
---|
| 16 | |
---|
[13196] | 17 | if [ ! -r ~/.hushlogin ]; then |
---|
| 18 | verbose_login=t # Echo messages unless user has ~/.hushlogin. |
---|
| 19 | fi |
---|
| 20 | |
---|
| 21 | /bin/stty sane # Use sane control characters |
---|
| 22 | |
---|
| 23 | # ******************* ENVIRONMENT SETUP ******************* |
---|
| 24 | |
---|
| 25 | # The ~/.bashrc file sets environment variables, attaches lockers, and sets |
---|
| 26 | # the command search path. It has already been sourced at this point. |
---|
| 27 | |
---|
| 28 | # Check that user home directory is available |
---|
| 29 | |
---|
| 30 | # ******************* DEVICE SETUP ******************* |
---|
| 31 | |
---|
| 32 | # Set device type if interactive session (e.g., dialup) |
---|
| 33 | |
---|
[17753] | 34 | case $TERM in |
---|
[13196] | 35 | switch|network|dialup|unknown) |
---|
| 36 | # The standard terminal emulation is vt100. To use a different |
---|
| 37 | # emulation, set the environmental variable DEF_TERM in your |
---|
| 38 | # ~/.bash_environment file to to the device you want to emulate |
---|
| 39 | # (one that the system will recognize). |
---|
| 40 | export DEF_TERM |
---|
[13242] | 41 | if [ "${DEF_TERM+set}" != set ]; then DEF_TERM=vt100; fi |
---|
[13480] | 42 | set -f; eval `tset -s -I -Q "?${DEF_TERM}"`; set +f |
---|
[13196] | 43 | ;; |
---|
| 44 | esac |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | # ******************* ACTIVITY STARTUP ******************* |
---|
| 48 | |
---|
| 49 | # Run standard system/user startup activities |
---|
| 50 | |
---|
| 51 | # Run default system startup activities. To skip these, put the command |
---|
[21128] | 52 | # "skip_tty_startup=t" in your ~/.bash_environment file. |
---|
[13196] | 53 | |
---|
[13242] | 54 | if [ "${ZEPHYR_CLIENT+set}" != set ]; then |
---|
[13196] | 55 | export ZEPHYR_CLIENT |
---|
[23737] | 56 | if [ ! -f /etc/athena/dialuptype ] || [ "fallback: true" = "`zctl show fallback`" ]; then |
---|
[22913] | 57 | ZEPHYR_CLIENT=zwgc |
---|
| 58 | else |
---|
| 59 | ZEPHYR_CLIENT='echo This is a dialup, so zwgc is not being run on login.' |
---|
| 60 | fi |
---|
[13196] | 61 | fi |
---|
| 62 | |
---|
[13242] | 63 | if [ "${skip_tty_startup+set}" != set ]; then |
---|
[13480] | 64 | if [ "${verbose_login+set}" = set ]; then |
---|
[13196] | 65 | echo "Running standard startup activities ..." |
---|
| 66 | fi |
---|
| 67 | $ZEPHYR_CLIENT # Start Zephyr client |
---|
[21128] | 68 | get_message -new -login # Display current motd |
---|
[23823] | 69 | if hesinfo "$USER" pobox | grep -qv EXCHANGE; then |
---|
[24307] | 70 | mailquota -n # Check quota on post office server |
---|
| 71 | from.debathena -t -n # Check for mail |
---|
[23823] | 72 | fi |
---|
[13242] | 73 | fi |
---|
[13196] | 74 | |
---|
| 75 | |
---|
| 76 | # Run the tty-session customizing commands in your ~/.startup.tty file. |
---|
| 77 | |
---|
| 78 | if [ -r ~/.startup.tty ]; then |
---|
[13242] | 79 | # Don't echo if noninteractive |
---|
[13480] | 80 | if [ "${verbose_login+set}" = set ]; then |
---|
[13196] | 81 | echo "Running custom startup activities listed in ~/.startup.tty ..." |
---|
| 82 | fi |
---|
| 83 | . ~/.startup.tty |
---|
| 84 | fi |
---|
| 85 | |
---|
| 86 | |
---|
| 87 | # Run notification system, lert. To skip this (a generally bad idea unless |
---|
[21128] | 88 | # you plan to run it yourself), put the command "skip_lert=t" in your |
---|
[13196] | 89 | # ~/.bash_environment file. |
---|
| 90 | |
---|
[13242] | 91 | if [ "${skip_lert+set}" != set ]; then |
---|
[13196] | 92 | lert -q # Don't want to see server errors. |
---|
| 93 | fi |
---|