spaceapi-server/package/archlinux/spaceapi-server.install

31 lines
608 B
Text
Raw Permalink Normal View History

2019-11-26 16:07:17 +01:00
post_install() {
if ! getent group spaceapi-server >/dev/null; then
groupadd --system spaceapi-server
fi
if ! getent passwd spaceapi-server >/dev/null; then
useradd --system --create-home --gid spaceapi-server --home-dir /var/lib/spaceapi-server \
--shell /usr/sbin/nologin spaceapi-server
fi
chown root:spaceapi-server /etc/spaceapi-server
chmod 0750 /etc/spaceapi-server
systemctl daemon-reload || true
}
pre_remove() {
systemctl stop spaceapi-server.service
userdel spaceapi-server
}
post_remove() {
systemctl daemon-reload
}