dataport: bash: combine tmux-auto-attach and keychain into one function
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
This commit is contained in:
parent
774767dab1
commit
c752c29b66
1 changed files with 16 additions and 8 deletions
24
.bash_extra
24
.bash_extra
|
@ -10,19 +10,27 @@ source "${BASH_SOURCE%/*}/.bash_ps1"
|
||||||
# add my scripts to PATH
|
# add my scripts to PATH
|
||||||
PATH=$PATH:"${BASH_SOURCE%/*}/scripts"
|
PATH=$PATH:"${BASH_SOURCE%/*}/scripts"
|
||||||
|
|
||||||
### tmux auto attach
|
## check interactive shell https://unix.stackexchange.com/questions/26676/how-to-check-if-a-shell-is-login-interactive-batch
|
||||||
# Check if the user ID is not 0 (root)
|
if [[ $- == *i* ]] ; then
|
||||||
if [ "$EUID" -ne 0 ]; then
|
### git-bash
|
||||||
# then auto attach
|
if [ "$HOSTNAME" = lzeorpt001 ]; then
|
||||||
|
source /usr/share/git-core/contrib/completion/git-prompt.sh
|
||||||
|
fi
|
||||||
|
### root alias
|
||||||
|
alias root='sudo -H -u root /usr/bin/sudo2uls'
|
||||||
|
### tmux auto attach
|
||||||
if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then
|
if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then
|
||||||
tmux attach -t default || tmux new -s default
|
tmux attach -t default || tmux new -s default
|
||||||
fi
|
fi
|
||||||
|
### keychain
|
||||||
|
if [ "$HOSTNAME" = lzeorpt001 ]; then
|
||||||
|
export GPG_TTY=$(tty)
|
||||||
|
fi
|
||||||
|
if [ "$(hostname -s)" == "lzeorpt001" ] || [ "$(hostname -s)" == "lbdlspa001" ]; then
|
||||||
|
eval $(keychain -q --eval --timeout 60 --agents ssh,gpg)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### keychain
|
|
||||||
eval "$(keychain -q --eval --timeout 60 --agents ssh,gpg)"
|
|
||||||
export GPG_TTY=$(tty)
|
|
||||||
|
|
||||||
### Praktische Dinge
|
### Praktische Dinge
|
||||||
# Deaktiviere FlowControl
|
# Deaktiviere FlowControl
|
||||||
# https://unix.stackexchange.com/questions/332791/how-to-permanently-disable-ctrl-s-in-terminal
|
# https://unix.stackexchange.com/questions/332791/how-to-permanently-disable-ctrl-s-in-terminal
|
||||||
|
|
Loading…
Reference in a new issue