#!/bin/sh
# if [ "x$(id -un)" != "xmastodon" ] ; then
#   echo "Please run this script as mastodon user" 1>&2
#   exit 1
# fi
set -ae
. /etc/sysconfig/mastodon
RAILS_ENV="${RAILS_ENV:=production}"
cd /srv/www/vhosts/mastodon/
test -e tmp/rebuild.txt || exit 0
/usr/bin/bundle.ruby3.1 exec /usr/bin/rake.ruby3.1 db:migrate assets:clean assets:precompile
chown -R mastodon:mastodon tmp/
#chmod -R go+rX public/{assets,images,javascripts,plugins,tombstone,uploads}
touch tmp/restart.txt
rm -f tmp/rebuild.txt
