Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bf571cb93 | ||
|
|
acf7521990 |
Executable
+20
@@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -Eeuo pipefail
|
||||||
|
|
||||||
|
# Reconecta a la sesion tmux persistente "lab" dentro del contenedor
|
||||||
|
# tmux-host. Si la sesion no existe (p.ej. el contenedor se acaba de
|
||||||
|
# recrear), la crea. El comando es siempre el mismo sin importar el
|
||||||
|
# estado previo.
|
||||||
|
#
|
||||||
|
# Ver docs-portal: arquitectura/sesion-tmux-persistente.md
|
||||||
|
|
||||||
|
CONTAINER="tmux-host"
|
||||||
|
SESSION="lab"
|
||||||
|
|
||||||
|
if ! docker ps --format '{{.Names}}' | grep -qx "$CONTAINER"; then
|
||||||
|
echo "El contenedor '$CONTAINER' no esta corriendo. Verifica con 'docker ps -a'." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker exec -it "$CONTAINER" tmux attach -t "$SESSION" || \
|
||||||
|
docker exec -it "$CONTAINER" tmux new -s "$SESSION"
|
||||||
Reference in new issue
Block a user