add forgejo_doctor.sh

This commit is contained in:
tengel 2024-07-18 11:34:19 -05:00
parent 6e9f34a20f
commit 6a3f4b1917

22
bin/forgejo_doctor.sh Executable file
View file

@ -0,0 +1,22 @@
#!/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
runuser -u git -- "${GBIN}" doctor --config "${GCNF}" check --all \
--log-file /tmp/forgejo_doctor.log
_EC=$?
exit ${_EC}