blob: 4e33cd20eba01f3524b08430aebbbd5d2b3e2864 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
CP_USER="couchpotato"
CP_GROUP="couchpotato"
CP_DIR="/var/lib/couchpotato"
## arg 1: the new package version
post_install() {
getent ${CP_GROUP} &> /dev/null || groupadd -r ${CP_GROUP} &> /dev/null
getent ${CP_USER} &> /dev/null || useradd -r -g ${CP_GROUP} -d ${CP_DIR} -s /usr/bin/nologin ${CP_USER} &> /dev/null
chown -R ${CP_USER}:${CP_GROUP} ${CP_DIR}
echo " >> If you want a custom user or path for CouchPotato, remember to edit the service file as well."
}
## arg 1: the new package version
## arg 2: the old package version
post_upgrade() {
chown -R ${CP_USER}:${CP_GROUP} ${CP_DIR}
}
## arg 1: the old package version
post_remove() {
userdel ${CP_USER} &> /dev/null
groupdel ${CP_GROUP} &> /dev/null || /bin/true
}
|