| 1 | #!/bin/sh |
| 2 | # Na installeren of bijwerken (deb, rpm en archlinux). Maakt de gebruiker |
| 3 | # bluegit en /var/lib/bluegit, zoals sysusers.d en tmpfiles.d. Zonder |
| 4 | # systemd-sysusers (een kale container) doen useradd en install het. |
| 5 | # De service wordt niet aangezet; een draaiende service herstart. |
| 6 | set -e |
| 7 | if command -v systemd-sysusers >/dev/null 2>&1; then |
| 8 | systemd-sysusers /usr/lib/sysusers.d/bluegit.conf || true |
| 9 | fi |
| 10 | if ! getent group bluegit >/dev/null 2>&1; then |
| 11 | groupadd --system bluegit |
| 12 | fi |
| 13 | if ! getent passwd bluegit >/dev/null 2>&1; then |
| 14 | useradd --system --gid bluegit --home-dir /var/lib/bluegit --no-create-home \ |
| 15 | --shell /usr/sbin/nologin --comment BlueGit bluegit |
| 16 | fi |
| 17 | if command -v systemd-tmpfiles >/dev/null 2>&1; then |
| 18 | systemd-tmpfiles --create /usr/lib/tmpfiles.d/bluegit.conf || true |
| 19 | fi |
| 20 | install -d -m 0750 -o bluegit -g bluegit /var/lib/bluegit |
| 21 | if [ -d /run/systemd/system ] && command -v systemctl >/dev/null 2>&1; then |
| 22 | systemctl daemon-reload || true |
| 23 | systemctl try-restart bluegit.service || true |
| 24 | fi |
| 25 | exit 0 |