#!/usr/bin/with-contenv bash # make our folders mkdir -p \ /config/www/{backgrounds,icons,avatars,SupportedApps} # copy .env if not exists [[ ! -f /config/www/.env ]] && \ cp /var/www/localhost/heimdall/.env /config/www/.env # set queue driver to database sed -i 's/QUEUE_DRIVER=sync/QUEUE_DRIVER=database/' /config/www/.env # create symlinks symlinks=( \ /var/www/localhost/heimdall/storage/app/public/avatars \ /var/www/localhost/heimdall/storage/app/public/backgrounds \ /var/www/localhost/heimdall/storage/app/public/icons \ /var/www/localhost/heimdall/app/SupportedApps \ /var/www/localhost/heimdall/database/app.sqlite \ /var/www/localhost/heimdall/.env ) 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 \ /var/www/localhost/heimdall