feat: merge nc scripts into ncm.sh
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

This commit is contained in:
cătălin 2024-09-23 09:56:29 +02:00
commit 9a270e02f6
No known key found for this signature in database
5 changed files with 35 additions and 149 deletions

35
scripts/ncm.sh Executable file
View file

@ -0,0 +1,35 @@
#!/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