27 lines
851 B
Bash
27 lines
851 B
Bash
|
#!/bin/bash
|
||
|
# sourced for bash login shell only
|
||
|
|
||
|
# uncomment these for debugging.
|
||
|
# echo ---- sourcing system .bash_profile for user $USER ---
|
||
|
# [[ $USER_ROOT ]] && echo 'Root User' || echo 'Non Root User'
|
||
|
# [[ $SHELL_INTERACTIVE ]] && echo 'Interactive' || echo 'Not interactive'
|
||
|
# [[ $SHELL_LOGIN ]] && echo 'Login shell' || echo 'Not login shell'
|
||
|
# [[ $SSH_SESSION ]] && echo ssh remote user || echo local user
|
||
|
# env | grep BASH
|
||
|
# echo ---------------------
|
||
|
|
||
|
|
||
|
# only source .bashrc if interactive login shell
|
||
|
if [[ $SHELL_INTERACTIVE ]]; then
|
||
|
[[ -f "/root/.bashrc" ]] && source "/root/.bashrc"
|
||
|
else
|
||
|
export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
|
||
|
fi
|
||
|
|
||
|
# only source .bashrc if interactive login shell
|
||
|
if [[ $SHELL_INTERACTIVE ]];then
|
||
|
[[ -f "$HOME/.bashrc" ]] && source "$HOME/.bashrc"
|
||
|
else
|
||
|
# noninteractive login shell
|
||
|
:
|
||
|
fi
|