disseminate/scripts/docker_run.sh

41 lines
927 B
Bash
Raw Normal View History

2024-03-29 06:51:46 +01:00
# I'm so bad at bash scripting
2024-03-29 14:15:24 +01:00
cat << EOF
____ ______________ __
/ __ \/ _/ ___/ ___// /
/ / / // / \__ \\__ \/ /
/ /_/ // / ___/ /__/ /_/
/_____/___//____/____(_)
EOF
if [ ! -d data ]; then
echo '-------------'
echo 'Data folder not found. Did you set up a volume?'
echo '-------------'
exit 1
fi
if [ ! -f data/config.json ]; then
echo '-------------'
echo 'Config file not found. Please create one.'
echo '-------------'
exit 1
fi
2024-03-29 06:51:46 +01:00
if [ -z "$(find posts -mindepth 1 -maxdepth 1)" ]; then
echo '-------------'
echo 'Posts directory is empty, copying default...'
echo '-------------'
2024-03-29 14:15:24 +01:00
cp -r default_posts/* data/posts
2024-03-29 06:51:46 +01:00
fi
if [ -z "$(find templates -mindepth 1 -maxdepth 1)" ]; then
echo '-------------'
echo 'Template directory is empty, copying default...'
echo '-------------'
2024-03-29 14:15:24 +01:00
cp -r default_templates/* data/templates
2024-03-29 06:51:46 +01:00
fi
echo 'Starting...'
node index.js
echo 'Exiting...'