add functions to change debug
This commit is contained in:
parent
2ceaedd73e
commit
29e43d9e31
1 changed files with 25 additions and 2 deletions
27
bashrc_add
27
bashrc_add
|
@ -2,8 +2,31 @@
|
||||||
#debug
|
#debug
|
||||||
|
|
||||||
# set SSHS to false, if not set
|
# set SSHS to false, if not set
|
||||||
if [ -z ${SSHS+x} ]; then SSHS=false;fi
|
if [ -z ${SSHS+x} ]; then export SSHS=false;fi
|
||||||
if [ -z ${MYSHELLCONFIG_DEBUG+x} ]; then MYSHELLCONFIG_DEBUG=false;fi
|
|
||||||
|
# define debug default
|
||||||
|
MYSHELLCONFIG_DEBUG_DEFAULT=false
|
||||||
|
# set debug to default, if not set
|
||||||
|
if [ -z ${MYSHELLCONFIG_DEBUG+x} ]; then export MYSHELLCONFIG_DEBUG=$MYSHELLCONFIG_DEBUG_DEFAULT;fi
|
||||||
|
|
||||||
|
turnondebug() {
|
||||||
|
change_debug true
|
||||||
|
}
|
||||||
|
|
||||||
|
turnoffdebug() {
|
||||||
|
change_debug false
|
||||||
|
}
|
||||||
|
|
||||||
|
change_debug () {
|
||||||
|
if $1; then
|
||||||
|
echo turn ON debug myshellconfig
|
||||||
|
export MYSHELLCONFIG_DEBUG=true
|
||||||
|
else
|
||||||
|
echo turn OFF debug myshellconfig
|
||||||
|
export MYSHELLCONFIG_DEBUG=false
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# check if we are a interactive shell
|
# check if we are a interactive shell
|
||||||
# https://guide.bash.academy/expansions/
|
# https://guide.bash.academy/expansions/
|
||||||
|
|
Loading…
Reference in a new issue