package-pipelines-miscellan.../ansible-semaphore/debian.postinst

26 lines
616 B
Text
Raw Normal View History

2023-12-05 23:40:22 +01:00
#!/bin/bash
set -e
if [[ "$1" == "configure" ]]; then
if ! getent group semaphore >/dev/null; then
groupadd --system semaphore
fi
if ! getent passwd semaphore >/dev/null; then
useradd --system --gid semaphore --home-dir /var/lib/semaphore --shell /bin/bash semaphore
fi
chown semaphore:semaphore /var/lib/semaphore
chmod 0750 /var/lib/semaphore
chown root:semaphore /etc/semaphore/config.json
chmod g+rx /etc/semaphore
chmod g+r /etc/semaphore/config.json
deb-systemd-helper enable semaphore.service
deb-systemd-invoke restart semaphore.service
fi