#!/bin/sh

BUNDLE_DIR='/usr/share/webapps/bookstack'

cd $BUNDLE_DIR

if [ "$(id -un)" != 'bookstack' ]; then
	exec su bookstack -c '"$0" "$@"' -- php artisan "$@"
else
	exec php artisan "$@"
fi
