31 lines
608 B
Text
31 lines
608 B
Text
|
|
||
|
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
|
||
|
|
||
|
}
|