fix .bashrc for root so it loads uci correctly
parent
9f677a3303
commit
d5c89e284e
|
@ -1,6 +1,5 @@
|
||||||
# this .bashrc for use ONLY with uci bash shell system
|
#!/bin/bash
|
||||||
|
#uncomment these for debugging.
|
||||||
# uncomment these for debugging.
|
|
||||||
# echo ---- sourcing system .bashrc for user $USER ---
|
# echo ---- sourcing system .bashrc for user $USER ---
|
||||||
# [[ $USER_ROOT ]] && echo 'Root User' || echo 'Non Root User'
|
# [[ $USER_ROOT ]] && echo 'Root User' || echo 'Non Root User'
|
||||||
# [[ $SHELL_INTERACTIVE ]] && echo 'Interactive' || echo 'Not interactive'
|
# [[ $SHELL_INTERACTIVE ]] && echo 'Interactive' || echo 'Not interactive'
|
||||||
|
@ -9,16 +8,32 @@
|
||||||
# env | grep BASH
|
# env | grep BASH
|
||||||
# echo ---------------------
|
# echo ---------------------
|
||||||
|
|
||||||
|
# should always be true but check anyway
|
||||||
# uncomment for custom processing
|
if ( [[ $SHELL_INTERACTIVE ]] );then
|
||||||
#if [[ $SHELL_LOGIN ]]; then
|
if ( [[ $BASH_SHELL_BASE_LOADED = true ]] ) ; then
|
||||||
# echo "login shell (called from .bash_profile)"
|
if [[ $BASH_SHELL_USER_DIR ]]; then
|
||||||
# fi
|
# echo loading user $USER shell at $BASH_SHELL_USER_DIR
|
||||||
|
if [[ -d $BASH_SHELL_USER_DIR ]]; then
|
||||||
if [[ $SSH_SESSION ]]; then
|
shell_process_directory "$BASH_SHELL_USER_DIR"
|
||||||
# echo remote ssh session
|
else
|
||||||
cd /opt
|
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
|
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
|
||||||
|
|
||||||
|
# anything below will be sourced whether or not UCI shell was invoked
|
||||||
# anything below will be sourced by all shell types (except non-interactive/login)
|
# anything below will be sourced by all shell types (except non-interactive/login)
|
||||||
export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
|
export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
|
|
@ -11,17 +11,18 @@
|
||||||
# echo ---------------------
|
# 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
|
# only source .bashrc if interactive login shell
|
||||||
if [[ $SHELL_INTERACTIVE ]];then
|
if [[ $SHELL_INTERACTIVE ]];then
|
||||||
[[ -f "$HOME/.bashrc" ]] && source "$HOME/.bashrc"
|
[[ -f "$HOME/.bashrc" ]] && source "$HOME/.bashrc"
|
||||||
else
|
else
|
||||||
# noninteractive login shell
|
export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
|
||||||
:
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# delete?
|
||||||
|
# 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
|
Loading…
Reference in New Issue