Files
deb-gitea-runner/pkg/DEBIAN/postinst
T
florian db512f7633
gitea-runner-release-local.yaml (push) Invalid workflow file
Initialcommit
2026-10-18 17:27:06 +02:00

36 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
set -e
case "$1" in
configure)
if ! getent passwd gitea-runner >/dev/null; then
adduser --system --group --no-create-home \
--home /var/lib/gitea-runner --shell /usr/sbin/nologin \
--gecos "Gitea Actions runner" gitea-runner
fi
install -d -o gitea-runner -g gitea-runner -m 0750 /var/lib/gitea-runner
install -d -o root -g gitea-runner -m 0750 /etc/gitea-runner
if [ ! -e /etc/gitea-runner/config.yaml ]; then
/usr/bin/gitea-runner generate-config > /etc/gitea-runner/config.yaml
chown root:gitea-runner /etc/gitea-runner/config.yaml
chmod 0640 /etc/gitea-runner/config.yaml
fi
if getent group docker >/dev/null; then
adduser --quiet gitea-runner docker || true
fi
if [ -d /run/systemd/system ]; then
systemctl daemon-reload || true
systemctl enable gitea-runner.service >/dev/null 2>&1 || true
if systemctl is-active --quiet gitea-runner.service; then
systemctl restart gitea-runner.service || true
fi
fi
;;
esac
exit 0