summaryrefslogtreecommitdiffstats
path: root/core/modules/bwlp-stage4-tweaks/data/etc/profile
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/bwlp-stage4-tweaks/data/etc/profile')
-rw-r--r--core/modules/bwlp-stage4-tweaks/data/etc/profile69
1 files changed, 69 insertions, 0 deletions
diff --git a/core/modules/bwlp-stage4-tweaks/data/etc/profile b/core/modules/bwlp-stage4-tweaks/data/etc/profile
new file mode 100644
index 00000000..2fb2ee67
--- /dev/null
+++ b/core/modules/bwlp-stage4-tweaks/data/etc/profile
@@ -0,0 +1,69 @@
+# /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
+
+# Stuff we might wanna know
+PWENT=
+[ -n "$UID" ] && PWENT=`getent passwd "$UID"`
+[ -z "$PWENT" ] && [ -n "$USER" ] && PWENT=`getent passwd "$USER"`
+if [ -n "$PWENT" ]; then
+ 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`
+fi
+unset PWENT
+
+if [ -L "/bin" ]; then
+ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/openslx/sbin:/opt/openslx/bin
+else
+ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/sbin:/opt/openslx/bin
+fi
+
+# If running interactively, then:
+if [ "${PS1-}" ]; then
+
+ if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
+ export PS1="[\u@\h \W]\\$ "
+ if [ -s /etc/bash.bashrc ]; then
+ . /etc/bash.bashrc
+ fi
+ if [ -s "$HOME/.bashrc" ]; then
+ . "$HOME/.bashrc"
+ fi
+ 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 TERMINFO='/lib/terminfo'
+
+fi
+
+# 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
+unset i
+
+# 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
+