26 lines
616 B
Text
26 lines
616 B
Text
|
#!/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
|
||
|
|