summarylogtreecommitdiffstats
path: root/sickgear.install
diff options
context:
space:
mode:
Diffstat (limited to 'sickgear.install')
-rw-r--r--sickgear.install64
1 files changed, 64 insertions, 0 deletions
diff --git a/sickgear.install b/sickgear.install
new file mode 100644
index 000000000000..fe3f623bcdcb
--- /dev/null
+++ b/sickgear.install
@@ -0,0 +1,64 @@
+post_install() {
+ systemd-sysusers sickgear.conf
+ systemd-tmpfiles --create sickgear.conf
+
+ 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
+ systemctl daemon-reload &> /dev/null
+
+ 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() {
+ 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:
+
+ rm -rf /opt/sickgear
+
+EOM
+ fi
+} \ No newline at end of file