shell-base/shell.env

61 lines
2.2 KiB
Bash
Raw Normal View History

# Shell Repos to Source
# if bash is not the shell don't bother to continue
[ ! "$SHELL" = "/bin/bash" ] && return 1
# sourced for non-login interactive shells
# sourced via /etc/bash.bashrc so for all machine users
# $BASH_SHELL_BASE # this MUST be set in /etc/profile
# $BASH_SHELL_NETWORK/all
# $BASH_SHELL_NETWORK/$NETWORKNAME
# $BASH_SHELL_HOST/all
# $BASH_SHELL_HOST/<hostname>
# also
# sourced via $HOME/.bashrc
# $HOME/shell or $HOME/BASH_SHELL_USER
# for the rare interactive login shell
# if you don't want the repos above sourced uncomment this next line
# $NO_LOGIN_BASHRC=true
# this is not effect non-interactive login shells like at user first login
# within each of those directories if load.sh exits it will be run
# otherwise files will be sourced exactly like load.sh in the base
# Using base shell setup repository
# https://git.kebler.net/kebler.net/bash-shell-base.git
# use these two if you want a common directory for all shell repos
# BASH_SHELL_BASE is set in /etc/profile
# load script in base repo to run
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
# if uncommented next line sets up implicit sourcing for non-interactive shells
export BASH_ENV=$BASH_SHELL_LOAD # use base repo
# if not using implicit sourcing for non-interactive shells then on can do this per script
##################
# source $BASH_SHELL_BASE/$BASH_SHELL_BASE/${$BASH_SHELL_LOAD:-load.sh}
# shopt -s expand_aliases
# < your script code >
# shopt -u expand_aliases
####################
# identify a network name that this host resides on
# like hostname but for the LAN network
# if unset then only /all will be sourced
export NETWORKNAME=238
# will use $BASH_SHELL_NETWORK/$NETWORKNAME under this directory unless specifically set
export BASH_SHELL_NETWORK=/opt/bash/shell/network
# will use $BASH_SHELL_HOST/<hostname> unless specifically set
export BASH_SHELL_HOST=/opt/bash/shell/host
# by default SHELL sources will be looked for under $HOME/bash/shell
# but can be user set below to $HOME/$BASH_SHELL_USER
# export BASH_SHELL_USER=<some directory under $HOME>
# load and export module loading functions library
source $BASH_SHELL_BASE/module.lib