···11+#!/bin/bash
22+set -e
33+44+echo "Starting script"
55+66+# Restore the database if it does not already exist.
77+if [ -f /data/data.db ]; then
88+ echo "Database already exists, skipping restore"
99+else
1010+ echo "No database found, restoring from replica if exists"
1111+ litestream restore -if-replica-exists /data/data.db
1212+fi
1313+1414+# Run litestream with your app as the subprocess.
1515+exec litestream replicate -exec "/space"