bash: tmux azuto-attach not for root

This commit is contained in:
Michael Grote 2023-11-24 14:31:20 +01:00
parent 39f988fc44
commit 7051ef7d96

View file

@ -1,8 +1,12 @@
#!/bin/bash
### tmux auto attach
# Check if the user ID is not 0 (root)
if [ "$EUID" -ne 0 ]; then
if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then
tmux attach -t default || tmux new -s default
fi
fi
### keychain
eval "$(keychain -q --eval --timeout 60 --agents ssh,gpg)"