xref: /titanic_52/usr/src/cmd/nsadmin/etc-profile.sh (revision d1515e527c5d324d2c75e58781f1dd47f18624d8)
1ead1f93eSLiane Praza#
2ead1f93eSLiane Praza# CDDL HEADER START
3ead1f93eSLiane Praza#
4ead1f93eSLiane Praza# The contents of this file are subject to the terms of the
5ead1f93eSLiane Praza# Common Development and Distribution License (the "License").
6ead1f93eSLiane Praza# You may not use this file except in compliance with the License.
7ead1f93eSLiane Praza#
8ead1f93eSLiane Praza# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9ead1f93eSLiane Praza# or http://www.opensolaris.org/os/licensing.
10ead1f93eSLiane Praza# See the License for the specific language governing permissions
11ead1f93eSLiane Praza# and limitations under the License.
12ead1f93eSLiane Praza#
13ead1f93eSLiane Praza# When distributing Covered Code, include this CDDL HEADER in each
14ead1f93eSLiane Praza# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15ead1f93eSLiane Praza# If applicable, add the following below this CDDL HEADER, with the
16ead1f93eSLiane Praza# fields enclosed by brackets "[]" replaced with your own identifying
17ead1f93eSLiane Praza# information: Portions Copyright [yyyy] [name of copyright owner]
18ead1f93eSLiane Praza#
19ead1f93eSLiane Praza# CDDL HEADER END
20ead1f93eSLiane Praza#
21ead1f93eSLiane Praza# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
22ead1f93eSLiane Praza# Use is subject to license terms.
23*d1515e52SAlexander Eremin# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
24ead1f93eSLiane Praza
25ead1f93eSLiane Praza# The profile that all logins get before using their own .profile.
26ead1f93eSLiane Praza
27ead1f93eSLiane Prazatrap ""  2 3
28ead1f93eSLiane Prazaexport LOGNAME PATH
29ead1f93eSLiane Praza
30ead1f93eSLiane Prazaif [ "$TERM" = "" ]
31ead1f93eSLiane Prazathen
32*d1515e52SAlexander Eremin	if [ `uname -p` = "i386" ]; then
33ead1f93eSLiane Praza		TERM=sun-color
34ead1f93eSLiane Praza	else
35ead1f93eSLiane Praza		TERM=sun
36ead1f93eSLiane Praza	fi
37ead1f93eSLiane Praza	export TERM
38ead1f93eSLiane Prazafi
39ead1f93eSLiane Praza
40ead1f93eSLiane Praza#	Login and -su shells get /etc/profile services.
41ead1f93eSLiane Praza#	-rsh is given its environment in its .profile.
42ead1f93eSLiane Praza
43ead1f93eSLiane Prazacase "$0" in
44ead1f93eSLiane Praza-sh | -ksh | -ksh93 | -jsh | -bash | -zsh)
45ead1f93eSLiane Praza
46ead1f93eSLiane Praza	if [ ! -f .hushlogin ]
47ead1f93eSLiane Praza	then
48ead1f93eSLiane Praza		/usr/sbin/quota
49ead1f93eSLiane Praza		#	Allow the user to break the Message-Of-The-Day only.
50ead1f93eSLiane Praza		trap "trap '' 2"  2
51ead1f93eSLiane Praza		/bin/cat -s /etc/motd
52ead1f93eSLiane Praza		trap "" 2
53ead1f93eSLiane Praza
54ead1f93eSLiane Praza		/bin/mail -E
55ead1f93eSLiane Praza		case $? in
56ead1f93eSLiane Praza		0)
57ead1f93eSLiane Praza			echo "You have new mail."
58ead1f93eSLiane Praza		  	;;
59ead1f93eSLiane Praza		2)
60ead1f93eSLiane Praza			echo "You have mail."
61ead1f93eSLiane Praza		   	;;
62ead1f93eSLiane Praza		esac
63ead1f93eSLiane Praza	fi
64ead1f93eSLiane Prazaesac
65ead1f93eSLiane Praza
66ead1f93eSLiane Prazaumask 022
67ead1f93eSLiane Prazatrap  2 3
68