blob: 34c1b3c5b073cc3bad4320c70d3565c1379395cc (
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="/opt/couchpotato"
## arg 1: the new package version
post_install() {
groupadd ${CP_GROUP} &> /dev/null
useradd -g ${CP_GROUP} -d ${CP_DIR} -s /bin/false ${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
}
|