mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-17 09:58:16 +01:00
Update run.sh
This commit is contained in:
@@ -6,13 +6,21 @@ sed -i "s|/usr/bin/with-contenv|/usr/bin/env|g" /etc/cont-init.d/*
|
||||
|
||||
LOCATION=/data
|
||||
mkdir -p "$LOCATION"
|
||||
touch "$LOCATION"/database.sqlite || true
|
||||
chown -R wger "$LOCATION" || true
|
||||
chmod -R 777 "$LOCATION" || true
|
||||
|
||||
if [ ! -f "$LOCATION"/database.sqlite ]; then
|
||||
if [ -f "/home/wger/db/database.sqlite" ]; then
|
||||
cp /home/wger/db/database.sqlite "$LOCATION"/database.sqlite
|
||||
else
|
||||
touch "$LOCATION"/database.sqlite
|
||||
fi
|
||||
fi
|
||||
|
||||
chown -R wger "$LOCATION"
|
||||
chmod -R 777 "$LOCATION"
|
||||
rm /home/wger/db/database.sqlite &>/dev/null || true
|
||||
ln -s "$LOCATION"/database.sqlite /home/wger/db
|
||||
|
||||
python3 manage.py migrate || true
|
||||
|
||||
echo "Launch app"
|
||||
su -m -l wger -c "cd /home/wger/src && export FROM_EMAIL='wger Workout Manager <wger@example.com>' && exec /home/wger/entrypoint.sh"
|
||||
su -l wger -c "cd /home/wger/src && export FROM_EMAIL='wger Workout Manager <wger@example.com>' && exec /home/wger/entrypoint.sh"
|
||||
|
||||
Reference in New Issue
Block a user