/etc/cont-init.d/99-run.sh

This commit is contained in:
jokob-sk
2025-01-12 16:46:23 +11:00
parent a2ac52f523
commit fb2429ee66
4 changed files with 10 additions and 2 deletions

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bashio
# shellcheck shell=bash
set -e
bashio::log.warning "App starting."
# In the addon script, make symlinks on the fly
echo "Creating symlinks"
for folder in config db; do
echo "Creating for $folder"
# Create symlinks
mkdir -p /config/"$folder"
if [ -d /app/"$folder" ] && [ "$(ls -A /app/"$folder")" ]; then
cp -rn /app/"$folder"/* /config/"$folder"/
fi
rm -r /app/"$folder"
ln -sf /config/"$folder" /app/"$folder"
done
chmod a+rwx /config/db/app.db
sudo chown -R nginx:www-data /config/db/
sudo chown -R nginx:www-data /config/config/
##############
# LAUNCH APP #
##############
chmod +x /app/dockerfiles/start.sh
/app/dockerfiles/start.sh