2024-10-14 12:51:12 -07:00
|
|
|
#!/bin/bash
|
|
|
|
#uncomment these for debugging.
|
2023-01-18 16:43:21 -08:00
|
|
|
# echo ---- sourcing system .bashrc 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 ---------------------
|
|
|
|
|
2024-10-14 12:51:12 -07:00
|
|
|
# should always be true but check anyway
|
|
|
|
if ( [[ $SHELL_INTERACTIVE ]] );then
|
|
|
|
if ( [[ $BASH_SHELL_BASE_LOADED = true ]] ) ; then
|
|
|
|
if [[ $BASH_SHELL_USER_DIR ]]; then
|
|
|
|
# echo loading user $USER shell at $BASH_SHELL_USER_DIR
|
|
|
|
if [[ -d $BASH_SHELL_USER_DIR ]]; then
|
|
|
|
shell_process_directory "$BASH_SHELL_USER_DIR"
|
|
|
|
else
|
|
|
|
echo no user shell directory at $BASH_SHELL_USER_DIR to process
|
|
|
|
echo creating one now
|
|
|
|
declare dir
|
|
|
|
mkdir -p $BASH_SHELL_USER_DIR
|
|
|
|
for dir in $(cat $BASH_SHELL_BASE/.bash-shell-include); do
|
|
|
|
mkdir -p $BASH_SHELL_USER_DIR/$dir
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo WARNING! user environment variable BASH_SHELL_USER_DIR was not set in $BASH_SHELL_BASE/shell.env
|
|
|
|
echo user uci shell will not load
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
# uncomment to add non-interactive setup/sourcing
|
|
|
|
# else
|
|
|
|
# echo non-login and non-interactive
|
|
|
|
fi
|
2023-01-18 16:43:21 -08:00
|
|
|
|
2024-10-14 12:51:12 -07:00
|
|
|
# anything below will be sourced whether or not UCI shell was invoked
|
2023-01-18 16:43:21 -08:00
|
|
|
# anything below will be sourced by all shell types (except non-interactive/login)
|
2024-10-14 12:51:12 -07:00
|
|
|
export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
|