summarylogtreecommitdiffstats
path: root/sickrage.install
blob: 51a28cae61c5fd236d462699761f3a373731d886 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
SICKRAGE_USER="sickrage"
SICKRAGE_GROUP="sickrage"
SICKRAGE_DIR="/opt/sickrage"

post_install() {
    getent group ${SICKRAGE_GROUP} &> /dev/null || groupadd -r ${SICKRAGE_GROUP} &> /dev/null
    getent passwd ${SICKRAGE_USER} &> /dev/null || useradd -r -g ${SICKRAGE_GROUP} -d ${SICKRAGE_DIR} -s /usr/bin/nologin ${SICKRAGE_USER} &> /dev/null
    chown -R ${SICKRAGE_USER}:${SICKRAGE_GROUP} ${SICKRAGE_DIR}
}

post_upgrade() {
  chown -R ${SICKRAGE_USER}:${SICKRAGE_GROUP} ${SICKRAGE_DIR}
}

post_remove() {
    userdel ${SICKRAGE_USER} &> /dev/null
    groupdel ${SICKRAGE_GROUP} &> /dev/null || /bin/true
}