File bookstack-upgrade.sh of Package bookstack
#!/bin/bash
set -e
if [ ! -e /srv/www/webapps/bookstack/storage/framework/pending_upgrade ]; then
exit 0
fi
echo "Upgrading bookstack"
echo "Starting upgrade of bookstack: $(date)" >> /var/log/bookstack/upgrade.log
# Remove cache files
rm -f /srv/www/webapps/bookstack/bootstrap/cache/*.php 2>/dev/null ||:
/usr/sbin/bookstack-manage down >> /var/log/bookstack/upgrade.log 2>&1 ||:
/usr/sbin/bookstack-manage migrate --force >> /var/log/bookstack/upgrade.log 2>&1 ||:
/usr/sbin/bookstack-manage config:clear >> /var/log/bookstack/upgrade.log 2>&1 ||:
/usr/sbin/bookstack-manage cache:clear >> /var/log/bookstack/upgrade.log 2>&1 ||:
/usr/sbin/bookstack-manage view:clear >> /var/log/bookstack/upgrade.log 2>&1 ||:
# Cache config
/usr/sbin/bookstack-manage config:cache >> /var/log/bookstack/upgrade.log 2>&1 ||:
/usr/sbin/bookstack-manage up >> /var/log/bookstack/upgrade.log 2>&1 ||:
echo >> /var/log/bookstack/upgrade.log
rm -f /srv/www/webapps/bookstack/storage/framework/pending_upgrade