mirror of
https://github.com/linuxserver/docker-heimdall.git
synced 2025-10-26 18:53:40 +09:00
34 lines
759 B
Plaintext
34 lines
759 B
Plaintext
#!/usr/bin/with-contenv bash
|
|
|
|
# create folders
|
|
mkdir -p \
|
|
/config/www/{backgrounds,icons}
|
|
|
|
# set base url if needed
|
|
rm -rf /app/root
|
|
if [ -z "$BASEURL" ]; then
|
|
echo "No base url set. You can access the app at http://SERVERIP:PORT"
|
|
ln -s ./heimdall/public /app/root
|
|
else
|
|
echo "Setting base url. You can access the app at http://SERVERIP:PORT/$BASEURL"
|
|
mkdir -p /app/root
|
|
ln -s ../heimdall/public /app/root/"$BASEURL"
|
|
fi
|
|
|
|
# symlink user config
|
|
|
|
symlinks=( \
|
|
/app/heimdall/storage/app/public/backgrounds \
|
|
/app/heimdall/storage/app/public/icons \
|
|
/app/heimdall/database/app.sqlite )
|
|
|
|
for i in "${symlinks[@]}"
|
|
do
|
|
[[ -e "$i" && ! -L "$i" ]] && rm -rf $i; ln -s /config/www/$(basename "$i") "$i"
|
|
done
|
|
|
|
# permissions
|
|
chown -R abc:abc \
|
|
/config \
|
|
/app
|