summaryrefslogtreecommitdiffstats
path: root/core/rootfs/rootfs-stage32/data/etc/profile
blob: cbc5dba24981c325ff0f5376ddd840c4686fd206 (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
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
# XXX: Use `backticks` here instead of $(this stuff) as we don't know which shell is running...

export UID=`id -u` 2> /dev/null

# If running interactively, then:
if [ "$PS1" ]; then

	if [ "$BASH" ]; then
		export PS1="[\u@\h \W]\\$ "
	else
		if [ "$UID" -eq 0 ]; then
			export PS1='# '
		else
			export PS1='$ '
		fi
	fi

	export HISTSIZE=1000
	export HISTFILESIZE=1000
	export PAGER='/bin/less'
	export EDITOR='/bin/vi'
	export INPUTRC=/etc/inputrc
	#export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile
	export TERMINFO='/lib/terminfo'

fi

# Stuff we might wanna know
PWENT=`getent passwd $USER`
export USER=`echo "$PWENT" | awk -F ':' '{print $1}'`
export GID=`echo "$PWENT" | awk -F ':' '{print $4}'`
export HOME=`echo "$PWENT" | awk -F ':' '{print $6}'`
export GROUP=`id -gn`
export LOGNAME=$USER
export HOSTNAME=`hostname`

# set TERM to xterm on SSH sessions
[ -n "$SSH_TTY" ] && export TERM=xterm

# Source configuration files from /etc/profile.d
for i in /etc/profile.d/*.sh ; do
	if [ -r "$i" ]; then
		. $i
	fi
done

# Sourcing /etc/profile.local - please add custom stuff to profile.local
# as /etc/profile may be overwritten by system updates
test -s /etc/profile.local && . /etc/profile.local

if [ -s "$HOME/.bashrc" ]; then
	. "$HOME/.bashrc"
fi