#!/bin/bash INST_NAME="$1" shift if [ -z "$INST_NAME" ]; then echo "Usage: $0 [ ... ]" exit 1 fi set -eu export CONTAINER_RUNTIME_ENDPOINT="unix:///run/containerd/containerd.sock" pod_id=$(crictl pods -q --state ready --name "$INST_NAME-{{ ansible_nodename }}") if [ -z "$pod_id" ]; then echo "Pod not found"; exit 1; fi container_id=$(crictl ps -q --name '^nextcloud$' -p "$pod_id") if [ -z "$container_id" ]; then echo "Container not found"; exit 1; fi exec crictl exec -it "$container_id" php /var/www/html/occ $@