prepare for temporary bashrc with tmux

This commit is contained in:
Jakobus Schürz 2023-05-02 08:18:49 +02:00
parent 1884a7ebff
commit 3ea2b6f1d2

View file

@ -16,6 +16,8 @@
# https://guide.bash.academy/expansions/ # https://guide.bash.academy/expansions/
# https://www.tldp.org/LDP/abs/html/refcards.html#AEN22473 # https://www.tldp.org/LDP/abs/html/refcards.html#AEN22473
if [[ $- = *i* ]] ; then if [[ $- = *i* ]] ; then
if [ "${BASHRC_TMP:-x}" == "x" ]
then
#echo "interactive shell" >&2 #echo "interactive shell" >&2
# define variables # define variables
@ -44,7 +46,7 @@ if [[ $- = *i* ]] ; then
[ -z "${GIT_COMMITTER_NAME+x}" ] && export GIT_COMMITTER_NAME=$FULLNAME [ -z "${GIT_COMMITTER_NAME+x}" ] && export GIT_COMMITTER_NAME=$FULLNAME
[ -z "${GIT_COMMITTER_EMAIL+x}" ] && export GIT_COMMITTER_EMAIL=$USEREMAIL [ -z "${GIT_COMMITTER_EMAIL+x}" ] && export GIT_COMMITTER_EMAIL=$USEREMAIL
# [ -z "${MSC_GIT_TIMEOUT+x}" ] && export MSC_GIT_TIMEOUT=5s # [ -z "${MSC_GIT_TIMEOUT+x}" ] && export MSC_GIT_TIMEOUT=5s
[ -z "${MSC_GIT_CHECKOUT_TIMEOUT+x}" ] && export MSC_GIT_CHECKOUT_TIMEOUT=20s [ -z "${MSC_GIT_CHECKOUT_TIMEOUT+x}" ] && export MSC_GIT_CHECKOUT_TIMEOUT=20s
[ -z "${MSC_GIT_SYNC+x}" ] && export MSC_GIT_SYNC=true [ -z "${MSC_GIT_SYNC+x}" ] && export MSC_GIT_SYNC=true
@ -70,8 +72,8 @@ if [[ $- = *i* ]] ; then
# P11M for etoken/smartcard authentification # P11M for etoken/smartcard authentification
# Use PKCS11_MODULE or P11M (comes from ssh, when connected from remote) only in context of startagent/loadagent # Use PKCS11_MODULE or P11M (comes from ssh, when connected from remote) only in context of startagent/loadagent
# which dnf >/dev/null 2>&1 [ -z "${P11M+x}" ] && P11M="$(dnf repoquery --installed -l p11-kit | grep \/p11-kit-proxy.so\$ | head -1)" # which dnf >/dev/null 2>&1 [ -z "${P11M+x}" ] && P11M="$(dnf repoquery --installed -l p11-kit | grep \/p11-kit-proxy.so\$ | head -1)"
# which dpkg >/dev/null 2>&1 && [ -z "${P11M+x}" ] && P11M="$(dpkg -L p11-kit-modules|grep \/p11-kit-proxy.so\$ | head -1)" # which dpkg >/dev/null 2>&1 && [ -z "${P11M+x}" ] && P11M="$(dpkg -L p11-kit-modules|grep \/p11-kit-proxy.so\$ | head -1)"
# Basics # Basics
@ -206,8 +208,8 @@ EOF
==8<=== finished configure new shell ================ $(date) ===============8<== ==8<=== finished configure new shell ================ $(date) ===============8<==
EOF EOF
#else #else
# echo "non-interactive shell" >&2 # echo "non-interactive shell" >&2
SCRIPTEXIT SCRIPTEXIT
# Start tmux if not defined as STARTTMUX in bashrc # Start tmux if not defined as STARTTMUX in bashrc
@ -227,5 +229,8 @@ EOF
logdebug "started tmux" logdebug "started tmux"
fi fi
logdebug "after" logdebug "after"
else
exec bash --rcfile "${BASHRC_TMP}"
fi
fi fi