]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blame - setup/profile
glibc: Disable multilib support on X86_64
[people/stevee/ipfire-3.x.git] / setup / profile
CommitLineData
03bb3da9
MT
1# /etc/profile
2
3# System wide environment and startup programs, for login setup
4# Functions and aliases go in /etc/bashrc
5
6# It's NOT a good idea to change this file unless you know what you
7# are doing. It's much better to create a custom.sh shell script in
8# /etc/profile.d/ to make custom changes to your environment, as this
9# will prevent the need for merging in future updates.
10
11pathmunge () {
12 case ":${PATH}:" in
13 *:"$1":*)
14 ;;
15 *)
16 if [ "$2" = "after" ] ; then
17 PATH=$PATH:$1
18 else
19 PATH=$1:$PATH
20 fi
21 esac
22}
23
24
25if [ -x /usr/bin/id ]; then
26 if [ -z "$EUID" ]; then
27 # ksh workaround
5ddd2088
SS
28 EUID=`/usr/bin/id -u`
29 UID=`/usr/bin/id -ru`
03bb3da9 30 fi
5ddd2088 31 USER="`/usr/bin/id -un`"
03bb3da9
MT
32 LOGNAME=$USER
33 MAIL="/var/spool/mail/$USER"
34fi
35
36# Path manipulation
37if [ "$EUID" = "0" ]; then
03bb3da9
MT
38 pathmunge /usr/sbin
39 pathmunge /usr/local/sbin
40else
41 pathmunge /usr/local/sbin after
42 pathmunge /usr/sbin after
03bb3da9
MT
43fi
44
5ddd2088
SS
45HOSTNAME=$(/usr/bin/hostnamectl --transient 2>/dev/null) || \
46HOSTNAME=$(/usr/bin/hostname 2>/dev/null) || \
47HOSTNAME=$(/usr/bin/uname -n)
48
03bb3da9
MT
49HISTSIZE=1000
50if [ "$HISTCONTROL" = "ignorespace" ] ; then
51 export HISTCONTROL=ignoreboth
52else
53 export HISTCONTROL=ignoredups
54fi
55
56export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
57
5ddd2088 58for i in /etc/profile.d/*.sh /etc/profile.d/sh.local ; do
03bb3da9
MT
59 if [ -r "$i" ]; then
60 if [ "${-#*i}" != "$-" ]; then
61 . "$i"
62 else
5ddd2088 63 . "$i" >/dev/null
03bb3da9
MT
64 fi
65 fi
66done
67
68unset i
5ddd2088
SS
69unset -f pathmunge
70
71# Source global bash config, when interactive but not posix or sh mode
72if test "$BASH" &&\
73 test -z "$POSIXLY_CORRECT" &&\
74 test "${0#-}" != sh &&\
75 test -r /etc/bashrc
76then
77 # Bash login shells run only /etc/profile
78 # Bash non-login shells run only /etc/bashrc
79 # Check for double sourcing is done in /etc/bashrc.
80 . /etc/bashrc
81fi
82