blob: 8e905bc6e7895bf74506e9340df17033a2ccf553 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
pre_install() {
if ! getent group phantombot >/dev/null; then
groupadd --system phantombot
fi
if ! getent passwd phantombot >/dev/null; then
useradd -m --system -c 'phantombot daemon user' -g phantombot -s /bin/false phantombot -d /opt/PhantomBot
fi
chsh phantombot -s /bin/bash
}
post_install(){
chown -R phantombot:phantombot /opt/PhantomBot
systemctl daemon-reload
}
pre_upgrade(){
pre_install $1
}
post_upgrade() {
post_install $1
}
pre_remove() {
systemctl stop phantombot.service
systemctl disable phantombot.service
}
post_remove() {
if getent passwd phantombot >/dev/null; then
userdel -r phantombot
fi
if getent group phantombot >/dev/null; then
groupdel phantombot
fi
}
|