This repository has been archived on 2022-02-20. You can view files and clone it, but cannot push or open issues or pull requests.
bash-shell-base/setup/profile
David Kebler e25e44a98d added setup directory with set of user and system source files that can be copied in new machine
changed setup.sh to load.sh
startup only loads system repos by default and allows passing directory argument
2020-11-10 14:09:08 -08:00

37 lines
1,019 B
Bash

#!/bin/bash
# main /etc/profile loaded for all logins
# more info see http://www.linuxfromscratch.org/blfs/view/svn/postlfs/profile.html
# Set the initial path
export PATH=/bin:/usr/bin
# uncomment for debugging
echo system profile /etc/profile sourced at login
# put no script code directly here.
# organize all script code in files /etc/profile.d
# sourcing
if [[ $- == *i* ]] && [[ $EUID -ne 0 ]]; then
echo non root interactive login shell, will not source /etc/profile.d
if [[ $FORCE_LOAD_BASH_SHELL_BASE ]]; then
echo "forcing source of shell base: $BASH_SHELL_BASE/$BASH_SHELL_LOAD"
source "$BASH_SHELL_BASE/$BASH_SHELL_LOAD"
else
BASH_SHELL_BASE_SOURCED=false
NORMAL="\[\e[0m\]"
RED="\[\e[1;31m\]"
GREEN="\[\e[1;32m\]"
PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
unset RED GREEN NORMAL
fi
else
echo sourcing /etc/profile.d
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
source $i
fi
done
unset i
fi
fi