Files
nextcloud-docker/scripts/test.sh
2026-04-17 08:44:28 +05:30

25 lines
578 B
Bash
Executable File

#!/usr/bin/env bash
# scripts/test.sh
set -euo pipefail
DOMAIN="nxt.bhatfamily.in"
HTTP_PORT=8082
HTTPS_PORT=8446
STRICT_TLS="${STRICT_TLS:-0}"
CURL_TLS_ARGS=("-k")
if [ "${STRICT_TLS}" = "1" ]; then
CURL_TLS_ARGS=()
fi
echo "==> Testing HTTP redirect..."
curl -I "http://${DOMAIN}:${HTTP_PORT}" >/dev/null
echo "==> Testing HTTPS endpoint..."
curl "${CURL_TLS_ARGS[@]}" -I "https://${DOMAIN}:${HTTPS_PORT}" >/dev/null
echo "==> Testing Nextcloud status.php..."
curl "${CURL_TLS_ARGS[@]}" "https://${DOMAIN}:${HTTPS_PORT}/status.php" >/dev/null
echo "All tests passed."