fix: dont tee load log (llog) to console -shows on container boot

master
Kebler Network System Administrator 2023-01-21 08:18:40 -08:00
parent a343849055
commit a13395e205
5 changed files with 6 additions and 17 deletions

1
env/history.env vendored
View File

@ -1,7 +1,6 @@
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

View File

@ -94,4 +94,5 @@ fsudo () # run a function as sudo
[[ "$(type -t $1)" == "function" ]] &&
ARGS="$@" && sudo bash -c "$(declare -f $1); $ARGS"
}
alias ssudo="ssudo "

View File

@ -64,9 +64,9 @@ else
mkdir -p $HOME/logs
touch $LOGIN_LOG
llog () {
echo "$@" 2>&1 | tee -a $LOGIN_LOG
echo "$@" >> $LOGIN_LOG 2>&1
}
export -f llog
export -f llog
llog "$(env | grep BASH)"
echo "$(date)" > $LOGIN_LOG
llog "non-interactive login shell for $USER"

View File

@ -5,8 +5,6 @@ install_dir=${install_dir:-"$(dirname $(dirname $(realpath "${BASH_SOURCE:-$0}")
[[ $1 == "-d" ]] && { shift; subdir=test; shift; } || subdir=shell
user=${1:-$USER}
echo $subdir $user $USER
[[ $(id -u $user 2> /dev/null) -eq 0 ]]
[[ $(id -u $user 2> /dev/null) -eq 0 ]] && echo user is root use root user copy script, exiting && return 1
[[ ! $(id -u $user) -ge 1000 ]] && echo "no user $user or user not a regular" && return 2
@ -16,8 +14,7 @@ echo $subdir $user $USER
user_home=$( getent passwd $user | cut -d: -f6 )
[[ ! $user_home ]] && echo no user home directory for $user in which to install shell files, exiting && return 4
echo $subdir $user $USER $user_home $dir
# echo DEBUG: $subdir $user $USER $user_home $dir
echo -e "*********** copying UCI BASH Shell .profile and bash_profile and .bashrc for user: $user *******"
files=$(find $install_dir/files/user -type f)
@ -25,13 +22,8 @@ for file in $files; do
install -C -m 660 -o $user -g ${2:-$user} $file $user_home
done
# sed -i 's/BASH_SHELL_USER_DIR=/export "$user_home\/$dir/' $user_home/.bashrc
if [[ ! subdir == "shell" ]]; then
echo "export BASH_SHELL_USER_DIR=$user_home/$subdir" >> $user_home/.ucishell
# var="export BASH_SHELL_USER_DIR="
# using $dir
# sed -i "s:${var}*.:${var}${dir}:" $user_home/.bashrc
fi
echo -e "*********** create UCI BASH Shell directories for user in $dir *******"

View File

@ -23,7 +23,7 @@ reload_shell () {
load_custom_shell_env () {
[[ -f $BASH_SHELL_HOST/shell.env ]] && source $BASH_SHELL_HOST/shell.env
[[ -f $HOME/${BASH_SHELL_USER:-shell}/shell.env ]] && source $HOME/${BASH_SHELL_USER:-shell}/shell.env
[[ -f $BASH_SHELL_USER_DIR/shell.env ]] && source $BASH_SHELL_USER_DIR/shell.env
[[ -f $BASH_SHELL_DEV/shell.env ]] && shell_process_directory $BASH_SHELL_DEV/shell.env
}
@ -51,8 +51,6 @@ load_shell_host_user_dev () {
###################### START LOAD SCRIPT #############################
load_custom_shell_env
([[ $BASH_ENV ]] && [[ ! $- == *i* ]] && [[ $BASH_USE_ALIAS ]]) && shopt -s expand_aliases
# process the base directory by default
@ -77,7 +75,7 @@ module_load shell-process-directory
# as set in shell.env
for dir in ${1:-$BASH_SHELL_DIRS}; do
# env | grep BASH
# echo base $dir
# echo loading dir $dir
shell_process_directory $dir
[[ "$dir" = "$BASH_SHELL_BASE" ]] && export BASH_SHELL_BASE_LOADED=true
done
@ -101,4 +99,3 @@ export BASH_SHELL_LOADED=true
# Note: $HOME/shell or $HOME/BASH_SHELL_USER are processed via $HOME/.bashrc