added shell.env.override file to make it easier to set special env without editing shell.env

added always available uci_shell_update function to update uci shell easily
master
David Kebler 2024-08-19 09:45:14 -07:00
parent 7582ca6b73
commit 3112ba0288
6 changed files with 18 additions and 4 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@ base.code-workspace
load/ucishellgiturl
/modules/scripting/btpl
/modules/scripting/smenu
shell.env.override

View File

@ -46,7 +46,7 @@ load_shell_user () {
load_shell_dev () {
module_load shell-process-directory
[[ $BASH_SHELL_DEV ]] && shell_process_directory $BASH_SHELL_DEV
[[ -d $BASH_SHELL_DEV ]] && shell_process_directory $BASH_SHELL_DEV
}
load_shell_host_user_dev () {
@ -106,6 +106,7 @@ if [[ $BASH_SHELL_HOME_NETWORK_LOAD ]] || [[ $BASH_SHELL_ALL_NETWORKS_LOAD ]] ||
fi
load_shell_host
[[ $BASH_LOAD_SHELL_DEV ]] && load_shell_dev
export BASH_SHELL_LOADED=true

View File

@ -95,3 +95,10 @@ dip () {
/bin/drill $ip4 | grep -A1 'ANSWER SECTION' | grep -v "ANSWER SECTION" | rev | cut -f1 | rev
fi
}
uci_shell_update () {
module_load uci-shell-install
update_shell_base
[[ -d $BASH_SHELL_HOST/modules ]] && update_shell_host
[[ -d $BASH_SHELL_NETWORK/modules ]] && update_shell_network
}

View File

@ -110,7 +110,7 @@ update_shell_base () {
if [[ ! $BASH_SHELL_GIT_REMOTE ]]; then
echo WARNING: BASH_SHELL_GIT_REMOTE is not set will use \'origin\'
fi
git pull ${BASH_SHELL_GIT_REMOTEE:-origin} master
git pull ${BASH_SHELL_GIT_REMOTE:-origin} master
}
update_shell_host () {
@ -120,7 +120,7 @@ update_shell_host () {
}
update_shell_network () {
[[ ! -d $BASH_SHELL_NETWORK/modules ]] && echo uci shell host repo not installed, run install_shell_host first && return 1
[[ ! -d $BASH_SHELL_NETWORK/modules ]] && echo uci shell network repo not installed, run install_shell_network if desired && return 1
cd $BASH_SHELL_NETWORK || { echo not directory $BASH_SHELL_NETWORK; return 2; }
git pull ${BASH_SHELL_GIT_REMOTE:-origin} master
}

View File

@ -24,6 +24,8 @@
! command -v bash >/dev/null 2>&1 && echo no bash command && return 1
export SHELL="$(command -v bash )"
[[ -f $BASH_SHELL_BASE/shell.env.override ]] && source $BASH_SHELL_BASE/shell.env.override
# without changing /etc/profile you can disable loading the UCI Shell system
# by uncommenting this line. It will only set up a simple prompt instead.
# if UCI shell is causing issues then one can invoke this

3
shell.env.override.off Normal file
View File

@ -0,0 +1,3 @@
# To use remove .off and put in any shell overrides
# export BASH_SAFE_MODE=true
# export BASH_SHELL_DEV=/some/special/dir