BlueGit

timfa bluegit

Files

bluegit / packaging / nfpm / bluegit.postinstall.sh

bluegit.postinstall.sh

bluegit.postinstall.sh 1.0 KiB Download Raw
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.
6set -e
7if command -v systemd-sysusers >/dev/null 2>&1; then
8 systemd-sysusers /usr/lib/sysusers.d/bluegit.conf || true
9fi
10if ! getent group bluegit >/dev/null 2>&1; then
11 groupadd --system bluegit
12fi
13if ! 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
16fi
17if command -v systemd-tmpfiles >/dev/null 2>&1; then
18 systemd-tmpfiles --create /usr/lib/tmpfiles.d/bluegit.conf || true
19fi
20install -d -m 0750 -o bluegit -g bluegit /var/lib/bluegit
21if [ -d /run/systemd/system ] && command -v systemctl >/dev/null 2>&1; then
22 systemctl daemon-reload || true
23 systemctl try-restart bluegit.service || true
24fi
25exit 0