26 lines
728 B
Text
26 lines
728 B
Text
|
#!/bin/bash
|
||
|
|
||
|
set -e
|
||
|
|
||
|
if [[ "$1" == "configure" ]]; then
|
||
|
|
||
|
if ! getent group forgejo-runner >/dev/null; then
|
||
|
groupadd --system forgejo-runner
|
||
|
fi
|
||
|
|
||
|
if ! getent passwd forgejo-runner >/dev/null; then
|
||
|
useradd --system --gid forgejo-runner --groups docker --home-dir /var/lib/forgejo-runner --create-home --shell /sbin/nologin forgejo-runner
|
||
|
fi
|
||
|
|
||
|
chown forgejo-runner:forgejo-runner /var/lib/forgejo-runner
|
||
|
chmod 0750 /var/lib/forgejo-runner
|
||
|
chown root:forgejo-runner /etc/forgejo-runner/config.yml
|
||
|
chmod g+rx /etc/forgejo-runner
|
||
|
chmod g+r /etc/forgejo-runner/config.yml
|
||
|
|
||
|
deb-systemd-helper enable forgejo-runner.service
|
||
|
deb-systemd-invoke restart forgejo-runner.service
|
||
|
|
||
|
fi
|
||
|
|