Zuletzt aktiv 1757241729

Script to pass as SSH command to open jail directly from host

tmuxjail.sh Orginalformat
1#!/usr/bin/env zsh
2
3if [ -z "$1" ]; then
4 echo "Usage: $0 <jailname>"
5 exit 1
6fi
7
8JAILT="jail-$1"
9JAIL="$1"
10
11if tmux has-session -t "$JAILT" 2>/dev/null; then
12 echo "attaching to existing : $JAILT"
13 tmux attach -t "$JAILT"
14else
15 echo "attaching new : $JAILT"
16 tmux new -s "$JAILT" "sudo bastille console $JAIL"
17fi