diff --git a/.gitignore b/.gitignore index 772670b..8e1c41f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ base.code-workspace /module.lib load/ucishellgiturl /modules/scripting/btpl -/modules/scripting/smenu \ No newline at end of file +/modules/scripting/smenu +shell.env.override diff --git a/load.sh b/load.sh index 2f9b50d..9106d1e 100755 --- a/load.sh +++ b/load.sh @@ -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 diff --git a/load/01-basic b/load/01-basic index ce2b894..fd2fbb7 100644 --- a/load/01-basic +++ b/load/01-basic @@ -94,4 +94,11 @@ dip () { else /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 } \ No newline at end of file diff --git a/modules/uci-shell-install.lib b/modules/uci-shell-install.lib index b3a3b19..5e3fd93 100644 --- a/modules/uci-shell-install.lib +++ b/modules/uci-shell-install.lib @@ -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 } diff --git a/shell.env b/shell.env index 71cb80c..f2618e6 100755 --- a/shell.env +++ b/shell.env @@ -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 diff --git a/shell.env.override.off b/shell.env.override.off new file mode 100644 index 0000000..d883c86 --- /dev/null +++ b/shell.env.override.off @@ -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 \ No newline at end of file