Merge branch 'master' of git.schuerz.at:public/myshellconfig

This commit is contained in:
Jakobus Schürz 2020-11-30 10:02:46 +01:00
commit 6112efc64c
3 changed files with 25 additions and 13 deletions

View file

@ -9,8 +9,9 @@
#trap 'failure ${LINENO} "$BASH_COMMAND"' ERR #trap 'failure ${LINENO} "$BASH_COMMAND"' ERR
# set SSHS to false, if not set # set some variables to defaults, if not set in .bashrc
[ -z ${SSHS+x} ] && export SSHS=false [ -z ${SSHS+x} ] && export SSHS=false
[ -z ${STARTTMUX+x} ] && export STARTTMUX=false
# check if we are a interactive shell # check if we are a interactive shell
# https://guide.bash.academy/expansions/ # https://guide.bash.academy/expansions/
@ -181,4 +182,23 @@ EOF
#else #else
# echo "non-interactive shell" >&2 # echo "non-interactive shell" >&2
SCRIPTEXIT SCRIPTEXIT
# Start tmux if not defined as STARTTMUX in bashrc
logdebug "start tmux ${STARTTMUXDEFAULT} - ${STARTTMUXDEFAULT-$STARTTMUX}"
if ${STARTTMUXDEFAULT-$STARTTMUX} ; then
cat << EOF
"User: $USER - $UID"
Starting or resuming screen session
Press CTRL+C to cancel screen startup
EOF
sleep 1
#screen -UxR
tmux attach-session
logdebug "started tmux"
fi
logdebug "after"
fi fi

View file

@ -79,18 +79,9 @@ if ! $SSHS; then
# Go HOME # Go HOME
#cd ${HOME} #cd ${HOME}
# Start tmux if not defined as STARTTMUX in bashrc
if test ! $TMUX && test $SSH_TTY && test $TERM != screen && test $(systemctl status tmux@${USER}.service 1>/dev/null 2>&1; echo $? ) -eq 0; then if test ! $TMUX && test $SSH_TTY && test $TERM != screen && test $(systemctl status tmux@${USER}.service 1>/dev/null 2>&1; echo $? ) -eq 0; then
cat << EOF STARTTMUXDEFAULT=true
"User: $USER - $UID"
Starting or resuming screen session
Press CTRL+C to cancel screen startup
EOF
sleep 1
#screen -UxR
tmux attach-session
fi fi
unset -f pathmunge unset -f pathmunge
@ -146,6 +137,7 @@ export -f reachable-default
[ -z "${SSH_AGENTS_DEFAULT_DIR+x}" ] || mkdir -p "${SSH_AGENTS_DEFAULT_DIR}" [ -z "${SSH_AGENTS_DEFAULT_DIR+x}" ] || mkdir -p "${SSH_AGENTS_DEFAULT_DIR}"
#cat << EOF > "${SSH_AGENTS_DEFAULT_DIR}/agent-default-$(hostname)" #cat << EOF > "${SSH_AGENTS_DEFAULT_DIR}/agent-default-$(hostname)"
#SSH_AUTH_SOCK=${SSH_AUTH_SOCK}; export SSH_AUTH_SOCK; #SSH_AUTH_SOCK=${SSH_AUTH_SOCK}; export SSH_AUTH_SOCK;
#SSH_AGENT_PID=${SSH_AGENT_PID}; export SSH_AGENT_PID; #SSH_AGENT_PID=${SSH_AGENT_PID}; export SSH_AGENT_PID;

@ -1 +1 @@
Subproject commit cc13a4b728c7b76c63e6dc42f320cec955d74227 Subproject commit cabfd44a8b1666e9b0c1b18f55646dd8ec25d0d9