fukuops/scripts/ncm.sh
cătălin 9a270e02f6
Some checks failed
checks / k8s (push) Successful in 34s
checks / pre-commit (push) Successful in 46s
checks / tflint (push) Successful in 23s
OpenTofu deployments / adguard (push) Failing after 37s
OpenTofu deployments / authentik (push) Failing after 3h12m53s
feat: merge nc scripts into ncm.sh
2024-09-23 09:56:29 +02:00

35 lines
688 B
Bash
Executable file

#!/usr/bin/env bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "$SCRIPT_DIR/../docker/nextcloud" || exit
docker_exec() {
docker compose exec nextcloud "$@"
}
occ_exec() {
docker_exec sudo -E -u www-data php occ "$@"
}
case "$1" in
upgrade)
occ_exec upgrade
;;
htaccess)
occ_exec maintenance:update:htaccess
;;
indices)
occ_exec db:add-missing-indices
;;
occ)
occ_exec "$@"
;;
exec)
docker_exec "$@"
;;
*)
echo "Usage: $0 {upgrade|htaccess|indices|occ <custom occ command>|exec <custom command>}"
exit 1
;;
esac