diff --git a/ssh_router.sh b/ssh_router.sh old mode 100644 new mode 100755 index 84fe133..fcc6a11 --- a/ssh_router.sh +++ b/ssh_router.sh @@ -29,7 +29,7 @@ start_container_if_needed() { --hostname "$CONTAINER" \ --label auto-cleanup=true \ -v "${XDG_RUNTIME_DIR}"/podman/podman.sock:/run/podman/podman.sock \ - "$IMAGE" sh -c "$TMUX_CMD has-session -t $TMUX_SESSION 2>/dev/null || $TMUX_CMD new-session -s $TMUX_SESSION" + "$IMAGE" elif ! podman inspect -f '{{.State.Running}}' "$CONTAINER" | grep -q true; then log "⚡ Starting existing container $CONTAINER..." podman start "$CONTAINER"