blob: b8e8bf3e4e8c86ad9ae071d7cd22d79ad8aceea6 (
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
post_install() {
systemd-sysusers sickgear.conf
systemd-tmpfiles --create sickgear.conf
systemctl daemon-reload &> /dev/null
if [ ! -d /opt/sickgear/data ]; then
mkdir -p -m 755 /opt/sickgear/data &> /dev/null
cat << 'EOM'
==> In order to start SickGear, you must issue the following command:
systemctl start sickgear.service
==> To have SickGear start automatically on system startup and after
==> version upgrades, also issue the following command:
systemctl enable sickgear.service
==> Once started, SickGear can be accessed by navigating your browser to:
http://localhost:8081/
EOM
fi
chown -R sickgear:sickgear /opt/sickgear &> /dev/null
}
pre_upgrade() {
if systemctl is-active sickgear.service &> /dev/null; then
systemctl stop sickgear.service &> /dev/null
fi
}
post_upgrade() {
post_install
if systemctl is-enabled sickgear.service &> /dev/null; then
systemctl start sickgear.service
fi
}
pre_remove() {
pre_upgrade
if systemctl is-enabled sickgear.service &> /dev/null; then
systemctl disable sickgear.service &> /dev/null
fi
}
post_remove() {
# Clean up leftovers (cached python files)
if [ -d /opt/sickgear/app ]; then
rm -fR /opt/sickgear/app &> /dev/null
fi
if ! rmdir /opt/sickgear/data &> /dev/null; then
cat << 'EOM'
==> Data directory has not been removed since it contains files.
==> If you no longer want your show data, you may removing it by issuing
==> the following command as root:
rm -rf /opt/sickgear
EOM
fi
}
|