mirror of
https://github.com/harivansh-afk/betterNAS.git
synced 2026-04-15 10:05:14 +00:00
19 lines
510 B
Bash
Executable file
19 lines
510 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
# shellcheck disable=SC1091
|
|
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../lib/runtime-env.sh"
|
|
|
|
headers="$(mktemp)"
|
|
trap 'rm -f "$headers"' EXIT
|
|
|
|
curl -fsS -D "$headers" -o /dev/null -X PROPFIND -H 'Depth: 0' "$BETTERNAS_EXAMPLE_MOUNT_URL"
|
|
|
|
if ! grep -Eq '^HTTP/[0-9.]+ 207' "$headers"; then
|
|
echo "WebDAV PROPFIND did not return 207 for $BETTERNAS_EXAMPLE_MOUNT_URL" >&2
|
|
cat "$headers" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "WebDAV verified: $BETTERNAS_EXAMPLE_MOUNT_URL"
|