mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-22 16:51:51 +02:00
/etc/cont-init.d/99-run.sh
This commit is contained in:
32
netalertx/rootfs/etc/cont-init.d/99-run.sh
Normal file
32
netalertx/rootfs/etc/cont-init.d/99-run.sh
Normal 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
|
||||
Reference in New Issue
Block a user