look for bash command and set to SHELL instead of looking for bash in SHELL environment

master
Kebler Network System Administrator 2021-04-19 17:25:22 -07:00
parent 4ad1946952
commit c8940fb4ea
1 changed files with 5 additions and 4 deletions

View File

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
# Shell Repos Environment # Shell Repos Environment
# echo loading shell.env # if bash is not installed then don't bother to continue
# if bash is not the shell don't bother to continue ! command -v bash >/dev/null 2>&1 && echo no bash command && return 1
[ ! "$SHELL" = "/bin/bash" ] && return 1 export SHELL=$(command -v bash )
# sourced for non-login interactive shells # sourced for non-login interactive shells
# sourced via /etc/bash.bashrc so for all machine users # sourced via /etc/bash.bashrc so for all machine users
# $BASH_SHELL_BASE # this MUST be set in /etc/profile # $BASH_SHELL_BASE # this MUST be set in /etc/profile
@ -31,7 +31,6 @@
# load script in base repo to run # load script in base repo to run
export BASH_SHELL_LOAD=$BASH_SHELL_BASE/load.sh # load.sh is default export BASH_SHELL_LOAD=$BASH_SHELL_BASE/load.sh # load.sh is default
export BASH_SHELL_STARTUP=$BASH_SHELL_BASE/startup.sh # strtup.sh is default export BASH_SHELL_STARTUP=$BASH_SHELL_BASE/startup.sh # strtup.sh is default
# if uncommented next lines sets up implicit sourcing for non-interactive shells # if uncommented next lines sets up implicit sourcing for non-interactive shells
# echo ----NON_INTERACTIVE SHELL INFO----- # echo ----NON_INTERACTIVE SHELL INFO-----
# echo enabling bash shell repos for non-inactive shell # echo enabling bash shell repos for non-inactive shell
@ -104,3 +103,5 @@ export BASH_SHELL_DIRS=$(echo $temp)
# now load and export module loading functions library # now load and export module loading functions library
source $BASH_SHELL_BASE/module.lib source $BASH_SHELL_BASE/module.lib
# echo end shell env