summarylogtreecommitdiffstats
path: root/jackett.install
diff options
context:
space:
mode:
Diffstat (limited to 'jackett.install')
-rw-r--r--jackett.install22
1 files changed, 7 insertions, 15 deletions
diff --git a/jackett.install b/jackett.install
index ce886756fb11..a2917f394089 100644
--- a/jackett.install
+++ b/jackett.install
@@ -1,12 +1,7 @@
-post_install() {
- chown -R jackett: /usr/lib/jackett
-}
-
post_upgrade() {
# 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/
@@ -17,18 +12,15 @@ post_upgrade() {
cp -a /usr/share/Jackett/.config/.mono /var/lib/jackett/
fi
- # Stop jackett so user's home directory can be changed.
- systemctl stop jackett
- if [[ "$( getent passwd jackett | cut -d: -f6 )" != "/var/lib/jackett" ]]; then
- usermod -d /var/lib/jackett jackett
- fi
-
echo "Configs copied from /usr/share/Jackett/.config/Jackett -> /var/lib/jackett/."
echo "After confirming, rm -rf /opt/Jackett /usr/share/Jackett."
- echo
- echo "To modify jackett user's home directory, the jackett service was stopped."
- echo "Start it again by running: sudo systemctl start jackett"
fi
- post_install "$1"
+ if [[ "$( getent passwd jackett | cut -d: -f6 )" != "/var/lib/jackett" ]]; then
+ usermod -d /var/lib/jackett jackett
+ if [[ $? -ne 0 ]]; then
+ echo "Could not change jackett users home directory."
+ echo "Run: sudo systemctl stop jackett ; sudo usermod -d /var/lib/jackett jackett ; sudo systemctl start jackett"
+ fi
+ fi
}