builder-web/packaging/debian/postinst

18 lines
462 B
Text
Raw Permalink Normal View History

2021-11-12 10:18:40 +00:00
#!/bin/sh
set -e
BUILDER_WEB_USER=builder
2021-11-13 15:45:32 +00:00
if ! getent group "$BUILDER_WEB_USER" >/dev/null; then
2021-11-12 10:18:40 +00:00
groupadd -g 497 $BUILDER_WEB_USER
fi
2021-11-13 15:45:32 +00:00
if ! getent passwd "$BUILDER_WEB_USER" >/dev/null; then
2021-11-12 10:18:40 +00:00
useradd -g 497 -u 497 -d /nonexistent -s /usr/sbin/nologin $BUILDER_WEB_USER
fi
mkdir -p /var/lib/builder-web
chown "$BUILDER_WEB_USER:$BUILDER_WEB_USER" /var/lib/builder-web
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
fi