[7733] | 1 | # Prototype global .login file |
---|
[22666] | 2 | # $Id: login,v 1.15 2007-08-22 18:11:08 ghudson Exp $ |
---|
[7733] | 3 | |
---|
| 4 | # This file is sourced by default user file ~/.login |
---|
| 5 | |
---|
[7860] | 6 | # SGI xwsh runs shells as login shells. We don't want this. |
---|
| 7 | if ($?XSESSION) then |
---|
| 8 | exit 0 |
---|
| 9 | endif |
---|
| 10 | |
---|
[17541] | 11 | # Remember the pid of the login shell; used by dustbuster. |
---|
| 12 | setenv ATHENA_LOGIN_SESSION $$ |
---|
| 13 | |
---|
[7733] | 14 | set initdir=/usr/athena/lib/init |
---|
| 15 | |
---|
[18895] | 16 | # Create a unique temporary directory for the session, and remember |
---|
| 17 | # the directory name in the environment. |
---|
| 18 | set sessiondir = "`$initdir/mksessiondir -s $$`" |
---|
| 19 | if ("$sessiondir" != "") then |
---|
| 20 | setenv ATHENA_SESSION_TMPDIR "$sessiondir" |
---|
| 21 | endif |
---|
[7733] | 22 | |
---|
| 23 | if (! -r ~/.hushlogin) then |
---|
| 24 | set verbose_login # Echo messages unless user has ~/.hushlogin. |
---|
| 25 | endif |
---|
| 26 | /bin/stty sane # Use sane control characters |
---|
| 27 | |
---|
[7860] | 28 | if ($hosttype == "sgi") then |
---|
| 29 | /bin/stty intr ^C |
---|
| 30 | endif |
---|
[7733] | 31 | |
---|
| 32 | # ******************* ENVIRONMENT SETUP ******************* |
---|
| 33 | |
---|
| 34 | # The ~/.cshrc file sets environment variables, attaches lockers, and sets |
---|
| 35 | # the command search path. It has already been sourced at this point. |
---|
| 36 | |
---|
| 37 | # Check that user home directory is available |
---|
| 38 | |
---|
| 39 | if ($?TMPHOME) then |
---|
| 40 | echo "WARNING:" |
---|
| 41 | echo "" |
---|
| 42 | echo "Your home directory is currently unavailable." |
---|
| 43 | echo "This is probably due to a problem with the" |
---|
| 44 | echo "fileserver on which your directory is stored." |
---|
| 45 | echo "" |
---|
| 46 | echo "You may use a temporary directory for this session." |
---|
| 47 | echo "If you do, any files you create and any mail you" |
---|
| 48 | echo "incorporate will be DELETED when you logout and lost forever." |
---|
| 49 | echo "" |
---|
| 50 | echo "Would you like to continue this session, using a TEMPORARY" |
---|
| 51 | echo -n "directory? (yes,no) [The default is no] " |
---|
| 52 | set answer = ($<) |
---|
| 53 | if ("$answer" =~ [yY]*) then |
---|
| 54 | echo "Continuing with temporary directory..." |
---|
| 55 | mkdir ~/Mail |
---|
| 56 | else |
---|
| 57 | kill -HUP $$ |
---|
| 58 | endif |
---|
| 59 | endif |
---|
| 60 | |
---|
| 61 | |
---|
| 62 | # ******************* DEVICE SETUP ******************* |
---|
| 63 | |
---|
[11660] | 64 | # On IRIX, the terminal type may not be set yet. |
---|
| 65 | if (! $?term) then |
---|
| 66 | eval `tset -s -Q` |
---|
| 67 | endif |
---|
| 68 | |
---|
[7733] | 69 | # Set device type if interactive session (e.g., dialup) |
---|
| 70 | |
---|
[11660] | 71 | if (("$term" == switch) || ("$term" == network) || ("$term" == dialup) \ |
---|
| 72 | || ("$term" == unknown)) then |
---|
[7733] | 73 | |
---|
| 74 | # The standard terminal emulation is vt100. To use a different emulation, |
---|
| 75 | # set the environmental variable DEF_TERM in your ~/.environment file to |
---|
| 76 | # to the device you want to emulate (one that the system will recognize). |
---|
| 77 | |
---|
| 78 | if (! $?DEF_TERM) setenv DEF_TERM vt100 |
---|
| 79 | set noglob; eval `tset -s -I -Q "?${DEF_TERM}"` || unset noglob |
---|
| 80 | |
---|
| 81 | endif |
---|
| 82 | |
---|
| 83 | |
---|
| 84 | # ******************* ACTIVITY STARTUP ******************* |
---|
| 85 | |
---|
| 86 | # Run standard system/user startup activities |
---|
| 87 | |
---|
| 88 | # Run default system startup activities. To skip these, put the command |
---|
| 89 | # "set skip_tty_startup" in your ~/.environment file. |
---|
| 90 | |
---|
[11436] | 91 | if (! $?ZEPHYR_CLIENT) setenv ZEPHYR_CLIENT zwgc |
---|
| 92 | |
---|
[7733] | 93 | if (! $?skip_tty_startup) then |
---|
| 94 | if ($?verbose_login) echo "Running standard startup activities ..." |
---|
| 95 | set ignoreeof # ^D won't log you out |
---|
[11436] | 96 | $ZEPHYR_CLIENT # Start Zephyr client |
---|
[13051] | 97 | get_message -new -login # Display current motd |
---|
[19883] | 98 | mailquota -n # Check quota on post office server |
---|
[7733] | 99 | from -t -n # Check for mail |
---|
| 100 | endif |
---|
| 101 | |
---|
| 102 | |
---|
| 103 | # Run the tty-session customizing commands in your ~/.startup.tty file. |
---|
| 104 | |
---|
| 105 | if (-r ~/.startup.tty) then |
---|
| 106 | if ($?verbose_login) then # Don't echo if noninteractive |
---|
| 107 | echo "Running custom startup activities listed in ~/.startup.tty ..." |
---|
| 108 | endif |
---|
| 109 | source ~/.startup.tty |
---|
| 110 | endif |
---|
[7773] | 111 | |
---|
| 112 | |
---|
[7782] | 113 | # Run notification system, lert. To skip this (a generally bad idea unless |
---|
[21127] | 114 | # you plan to run it yourself), put the command "set skip_lert" in your |
---|
[7773] | 115 | # ~/.environment file. |
---|
| 116 | |
---|
[7782] | 117 | if (! $?skip_lert) then |
---|
| 118 | lert -q # Don't want to see server errors. |
---|
[7773] | 119 | endif |
---|