added deploy for system/user/root shell files

master
David Kebler 2020-11-21 08:55:51 -08:00
parent c436c07493
commit 527636a48e
9 changed files with 26 additions and 24 deletions

View File

@ -3,7 +3,7 @@ alias eetcbashrc="sudo gedit /etc/bash.bashrc"
alias eetcprofile="sudo gedit /etc/profile"
alias eprofile="gedit $HOME/.bash_profile"
alias cbashrc="cp $HOME/.bashrc $BASH_SHELL_BASE/setup"
alias cetcbashrc="cp /etc/bash.bashrc $BASH_SHELL_BASE/setup"
alias cprofile="cp $HOME/.bash_profile $BASH_SHELL_BASE/setup"
alias cetcprofile="cp /etc/profile $BASH_SHELL_BASE/setup"
alias cbashrc="cp $HOME/.bashrc $BASH_SHELL_BASE/setup/user"
alias cetcbashrc="cp /etc/bash.bashrc $BASH_SHELL_BASE/setup/etc"
alias cprofile="cp $HOME/.bash_profile $BASH_SHELL_BASE/setup/user"
alias cetcprofile="cp /etc/profile $BASH_SHELL_BASE/setup/etc"

View File

@ -5,7 +5,7 @@
DIR=${1:-$(dirname ${BASH_SOURCE[0]})}
[[ $(declare -F | grep module_load) ]] && echo module lib already loaded || source "$BASH_SHELL_BASE/module.lib"
[[ $(declare -F | grep module_load) ]] || source "$BASH_SHELL_BASE/module.lib"
# uncomment for debuggin
# echo $USER running load script in $DIR

4
setup/deploy.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
sudo cp -viR $BASH_SHELL_BASE/setup/etc /etc/
cp -viR $BASH_SHELL_BASE/setup/user $HOME/
sudo cp -viR $BASH_SHELL_BASE/setup/root /root/

View File

@ -24,7 +24,7 @@ export BASH_SHELL_BASE=/opt/bash/shell/base # where
if [[ $- == *i* ]]; then # interactive?
echo interactive login shell
if [[ ! $NO_LOGIN_BASHRC ]]; then
echo loading $BASH_SHELL_LOAD
# echo loading $BASH_SHELL_LOAD
source "$BASH_SHELL_LOAD"
else
NORMAL="\[\e[0m\]"

View File

@ -2,15 +2,15 @@
mkdir -p $BASH_SHELL_BASE/setup/etc/profile.d
mkdir -p $BASH_SHELL_BASE/setup/user
mkdir -p $BASH_SHELL_BASE/setup/root
cp /etc/profile $BASH_SHELL_BASE/setup/etc
cp /etc/bash.bashrc $BASH_SHELL_BASE/setup/etc
cp /etc/profile.d/02-root.sh $BASH_SHELL_BASE/setup/etc/profile.d
cp /etc/profile.d/03-startup.sh $BASH_SHELL_BASE/setup/etc/profile.d
cp $HOME/.bash_profile $BASH_SHELL_BASE/setup/user
cp $HOME/.profile $BASH_SHELL_BASE/setup/user
cp $HOME/.bashrc $BASH_SHELL_BASE/setup/user
cp $HOME/.bash_logout $BASH_SHELL_BASE/setup/user
cp /root/.bash_profile $BASH_SHELL_BASE/setup/root
cp /root/.profile $BASH_SHELL_BASE/setup/root
cp /root/.bashrc $BASH_SHELL_BASE/setup/root
cp /root/.bash_logout $BASH_SHELL_BASE/setup/root
cp -vi /etc/profile $BASH_SHELL_BASE/setup/etc
cp -vi /etc/bash.bashrc $BASH_SHELL_BASE/setup/etc
cp -vi /etc/profile.d/02-root.sh $BASH_SHELL_BASE/setup/etc/profile.d
cp -vi /etc/profile.d/03-startup.sh $BASH_SHELL_BASE/setup/etc/profile.d
cp -vi $HOME/.bash_profile $BASH_SHELL_BASE/setup/user
cp -vi $HOME/.profile $BASH_SHELL_BASE/setup/user
cp -vi $HOME/.bashrc $BASH_SHELL_BASE/setup/user
cp -vi $HOME/.bash_logout $BASH_SHELL_BASE/setup/user
cp -vi /root/.bash_profile $BASH_SHELL_BASE/setup/root
cp -vi /root/.profile $BASH_SHELL_BASE/setup/root
cp -vi /root/.bashrc $BASH_SHELL_BASE/setup/root
cp -vi /root/.bash_logout $BASH_SHELL_BASE/setup/root

View File

@ -1 +1 @@
echo $USER .bashrc
# echo $USER .bashrc

View File

@ -1,2 +1,2 @@
# ~/.profile: executed by Bourne-compatible login shells.
echo $USER .profile
echo "for bash login shell only called if .bash_profile does not exist"

View File

@ -1,9 +1,7 @@
#!/bin/bash
# ~/.bash_logout: executed by bash(1) when login shell exits.
# when leaving the console clear the screen to increase privacy
if [ "$SHLVL" = 1 ]; then
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi
#now

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Shell Repos Environment
echo loading shell.env
# echo loading shell.env
# if bash is not the shell don't bother to continue
[ ! "$SHELL" = "/bin/bash" ] && return 1
# sourced for non-login interactive shells