2018-10-19 21:31:11 +02:00
|
|
|
|
|
|
|
post_install() {
|
|
|
|
|
2018-10-19 23:48:36 +02:00
|
|
|
if ! getent group matemat >/dev/null; then
|
|
|
|
groupadd --system matemat
|
|
|
|
fi
|
2018-10-19 21:31:11 +02:00
|
|
|
|
2018-10-19 23:48:36 +02:00
|
|
|
if ! getent passwd matemat >/dev/null; then
|
|
|
|
useradd --system --create-home --gid matemat --home-dir /var/lib/matemat --shell /usr/bin/nologin matemat
|
|
|
|
fi
|
2018-10-19 21:31:11 +02:00
|
|
|
|
2018-11-12 00:01:02 +01:00
|
|
|
chown matemat:matemat /var/lib/matemat
|
|
|
|
chmod 0750 /var/lib/matemat
|
|
|
|
ln -sf /var/lib/matemat/upload /usr/lib/matemat/static/upload
|
2018-10-19 21:31:11 +02:00
|
|
|
|
2018-11-04 21:44:30 +01:00
|
|
|
systemctl daemon-reload
|
|
|
|
|
2018-10-19 23:48:36 +02:00
|
|
|
}
|
2018-10-19 21:31:11 +02:00
|
|
|
|
2018-10-19 23:48:36 +02:00
|
|
|
pre_remove() {
|
2018-10-19 21:31:11 +02:00
|
|
|
|
2018-10-19 23:48:36 +02:00
|
|
|
systemctl stop matemat.service
|
|
|
|
userdel matemat
|
2018-10-19 21:31:11 +02:00
|
|
|
|
|
|
|
}
|
2018-11-04 21:44:30 +01:00
|
|
|
|
|
|
|
post_remove() {
|
|
|
|
|
|
|
|
systemctl daemon-reload
|
|
|
|
|
|
|
|
}
|