summarylogtreecommitdiffstats
path: root/jackett.install
diff options
context:
space:
mode:
authorDonald Webster2018-03-13 15:03:44 -0700
committerDonald Webster2018-03-13 16:27:53 -0700
commitdd3fe4f6e7763f0d5a8464f45f01e405ddd72438 (patch)
tree3af07d8b0a456db76a9f10e783ba500e52c20400 /jackett.install
parenta95d15d87b42aaebcf4e8aff93aff57b7eff7549 (diff)
downloadaur-dd3fe4f6e7763f0d5a8464f45f01e405ddd72438.tar.gz
Move binaries to /usr/lib/jackett, config/db to /var/lib/jackett and migrate existing data.
Diffstat (limited to 'jackett.install')
-rw-r--r--jackett.install27
1 files changed, 23 insertions, 4 deletions
diff --git a/jackett.install b/jackett.install
index e597c9a718ea..554d87241790 100644
--- a/jackett.install
+++ b/jackett.install
@@ -1,9 +1,28 @@
post_install() {
- systemd-sysusers jackett.conf
-
- chown -R jackett: /usr/share/Jackett /opt/Jackett
+ chown -R jackett: /usr/lib/jackett /var/lib/jackett
}
post_upgrade() {
- post_install $1
+ # At version 0.8.749-2 we moved configs to /var/lib/jackett, so
+ # migrate old config directory.
+ if [[ $(vercmp "0.8.749-2" "$2") -eq 1 ]]; then
+
+ # Check for existing old config directory and non-existance of new config file.
+ if [[ -d /usr/share/Jackett/.config/Jackett && ! -f /var/lib/jackett/ServerConfig.json ]]; then
+ cp -a /usr/share/Jackett/.config/Jackett/* /var/lib/jackett/
+ fi
+
+ # Check for existing old mono config directory and non-existance of new mono config directory.
+ if [[ -d /usr/share/Jackett/.config/.mono && ! -d /var/lib/jackett/.config/.mono ]]; then
+ mkdir -p /var/lib/jackett/.config/
+ cp -a /usr/share/Jackett/.config/.mono /var/lib/jackett/.config/
+ fi
+
+ # The jackett user's home directory needs to change too.
+ if [[ "$( getent passwd jackett | cut -d: -f6 )" != "/var/lib/jackett" ]]; then
+ usermod -d /var/lib/jackett jackett
+ fi
+ fi
+
+ post_install "$1"
}