mirror of
https://github.com/linuxserver/docker-heimdall.git
synced 2025-10-27 03:03:38 +09:00
35 lines
781 B
Plaintext
35 lines
781 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"
|
|
[[ ! -L "$i" ]] && ln -s /config/www/"$(basename "$i")" "$i"
|
|
done
|
|
|
|
# permissions
|
|
chown -R abc:abc \
|
|
/config \
|
|
/app
|