aboutsummaryrefslogtreecommitdiffstats
path: root/community/tcsh/csh.login
blob: 686822826e0770f6244a5ea58ee0205c38cf45f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#############################################################################
##
## Gentoo's csh.login
##
## 2003-01-13  -- Alain Penders (alain@gentoo.org)
##
##     Initial version.  Inspired by the Suse version.
##


##
## Default terminal initialization
##
if ( -o /dev/$tty && ${?prompt} ) then
    # Console
    if ( ! ${?TERM} )           setenv TERM linux
    if ( "$TERM" == "unknown" ) setenv TERM linux
    # No tset available on SlackWare
    if ( -x "`which stty`" ) stty sane cr0 pass8 dec
    if ( -x "`which tset`" ) tset -I -Q
    unsetenv TERMCAP
    settc km yes
endif

##
## Default UMASK
##
umask 022

##
## Set our SHELL variable.
##
setenv SHELL /bin/tcsh

##
## Setup a default MAIL variable
##
if ( -f /var/mail/$USER ) then
    setenv MAIL /var/mail/$USER
    set mail=$MAIL
endif

##
## If we're root, report who's logging in and out.
## disabled because musl libc doesn't support utmp
##if ( "$uid" == "0" ) then
##    set who=( "%n has %a %l from %M." )
##    set watch=( any any ) #
##endif

##
## Show the MOTD once the first time, and once after it has been changed.
##
## Note: if this is a SSH login, SSH will always show the MOTD, so we
## skip it.  Create ~/.hushlogin is you don't want SSH to show it.
##
if (-f /etc/motd ) then
    if ( ! $?SSH_CLIENT ) then
        cmp -s /etc/motd ~/.hushmotd
        if ($status) then
            tee ~/.hushmotd < /etc/motd
            echo "((( MOTD shown only once, unless it is changed )))"
        endif
    endif
endif

##
## Send us home.
##
cd