#!/usr/bin/with-contenv bash # create folders mkdir -p \ /config/www/{backgrounds,icons} # update from git repo cd /var/www/localhost/heimdall git pull [[ ! -z "$BRANCH" ]] && \ git checkout "$BRANCH" # symlink user config symlinks=( \ /var/www/localhost/heimdall/storage/app/public/backgrounds \ /var/www/localhost/heimdall/storage/app/public/icons \ /var/www/localhost/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 \ /var/www/localhost/heimdall