#!/usr/bin/env bash set -Eeuo pipefail PROFILE="/joplin-profile" : "${JOPLIN_WEBDAV_URL:?JOPLIN_WEBDAV_URL is required}" : "${JOPLIN_WEBDAV_USERNAME:?JOPLIN_WEBDAV_USERNAME is required}" : "${JOPLIN_WEBDAV_PASSWORD:?JOPLIN_WEBDAV_PASSWORD is required}" mkdir -p "$PROFILE" joplin --profile "$PROFILE" config sync.target 6 >/dev/null joplin --profile "$PROFILE" config sync.6.path "$JOPLIN_WEBDAV_URL" >/dev/null joplin --profile "$PROFILE" config sync.6.username "$JOPLIN_WEBDAV_USERNAME" >/dev/null joplin --profile "$PROFILE" config sync.6.password "$JOPLIN_WEBDAV_PASSWORD" >/dev/null joplin --profile "$PROFILE" config sync.wipeOutFailSafe true >/dev/null joplin --profile "$PROFILE" sync joplin --profile "$PROFILE" status