Files
Ethan O'Brien a761e26ac2 Initial commit
2024-09-23 09:17:49 -05:00

33 lines
869 B
Bash

#!/bin/bash
set -e
directory="${DIRECTORY:-/data/}"
cd /root/ooye/
export OOYE_DOCKER=1
npm i
cd $directory
if [ ! -d ./docs ]; then
cp -r /root/ooye/docs/ ./
fi
if [ ! -f ooye.db ] && [ -f /data/registration.yaml ] && [ -d /matrix ]; then
cp /data/registration.yaml /matrix/registration.yaml
if [ ! $(grep -q "app_service_config_files" /matrix/homeserver.yaml) ]; then
echo "app_service_config_files:" >> /matrix/homeserver.yaml
echo " - \"/data/registration.yaml\"" >> /matrix/homeserver.yaml
fi
fi
if [ -f ooye.db ] && [ -f /data/registration.yaml ]; then
node /root/ooye/addbot.js
else
echo "Detected incomplete out-of-your-element registration. Please run \`docker exec -it ooye su\` to open a shell, then run \`cd $directory && OOYE_DOCKER=1 node /root/ooye/scripts/seed.js\`. Then, restart your docker container."
fi
node /root/ooye/start.js