This repository has been archived on 2025-12-28. You can view files and clone it, but cannot push or open issues or pull requests.
inks-scripts/scripts/tmux-worker

16 lines
345 B
Bash
Executable File

#!/bin/bash
session="system"
# Check if the session exists, discarding output
# We can check $? for the exit status (zero for success, non-zero for failure)
tmux has-session -t $session 2>/dev/null
if [ $? != 0 ]; then
# Set up your session
tmux new-session -s "$session"
fi
# Attach to created session
tmux attach-session -t "$session"