generic doctor usage

This commit is contained in:
tengel 2025-10-26 05:11:01 -05:00
parent d931f53612
commit 4dc1cfd5f2

28
bin/forgejo_usedoc.sh Executable file
View file

@ -0,0 +1,28 @@
#!/usr/bin/env bash
#
# Run Forgejo doctor
#
# SPDX-License-Identifier: MIT
_VERSION="0.0.1"
GCNF="/var/xyzzy/etc/forgejo/app.ini"
GBIN="/var/xyzzy/bin/forgejo"
if [[ $(id -u) -ne 0 ]]; then
echo "Must run as root user"
exit 1
fi
# fallback
if [[ $# -eq 0 ]]; then
_OPTS="--help"
else
_OPTS="$@"
fi
runuser -u git -- "${GBIN}" doctor --config "${GCNF}" ${_OPTS}
_EC=$?
exit ${_EC}