mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-13 11:21:02 +01:00
28 lines
812 B
Bash
28 lines
812 B
Bash
#!/usr/bin/env bashio
|
|
|
|
chmod +x /etc/cont-init.d/*
|
|
sed -i "s|/usr/bin/with-contenv|/usr/bin/env|g" /etc/cont-init.d/*
|
|
/./etc/cont-init.d/00-banner.sh
|
|
|
|
LOCATION=/data
|
|
mkdir -p "$LOCATION"
|
|
echo "Defining database"
|
|
touch "$LOCATION"/database.sqlite
|
|
ln -s "$LOCATION"/database.sqlite /home/wger/db
|
|
|
|
echo "Updating database"
|
|
python3 manage.py migrate || true
|
|
|
|
echo "Defining permissions"
|
|
chown -R wger:wger "$LOCATION"
|
|
chown -R wger:wger "/home/wger"
|
|
chmod -R 777 "$LOCATION"
|
|
|
|
echo "Launch app"
|
|
#pip install -e . &>/dev/null
|
|
#exec /home/wger/entrypoint.sh
|
|
sed -i "1a cd /home/wger/src" /home/wger/entrypoint.sh
|
|
#sed -i "s|manage.py|/home/wger/src/manage.py|g" /home/wger/entrypoint.sh
|
|
#sed -i "s|wger bootstrap|/home/wger/src/wger bootstrap|g" /home/wger/entrypoint.sh
|
|
su wger -c "/bin/bash /home/wger/entrypoint.sh"
|