2015-06-20 03:56:05 +02:00
|
|
|
post_upgrade() {
|
2018-03-19 18:09:32 +01:00
|
|
|
if (( $(vercmp "0.8.749-2" "$2") > 0 )); then
|
2018-03-13 23:03:44 +01:00
|
|
|
if [[ -d /usr/share/Jackett/.config/Jackett && ! -f /var/lib/jackett/ServerConfig.json ]]; then
|
|
|
|
cp -a /usr/share/Jackett/.config/Jackett/* /var/lib/jackett/
|
2018-03-19 18:09:32 +01:00
|
|
|
echo "Copied config and db from /usr/share/Jackett/.config/Jackett/ -> /var/lib/jackett/"
|
2018-03-13 23:03:44 +01:00
|
|
|
fi
|
|
|
|
|
2018-03-19 04:31:55 +01:00
|
|
|
if [[ -d /usr/share/Jackett/.config/.mono && ! -d /var/lib/jackett/.mono ]]; then
|
2018-03-14 23:37:26 +01:00
|
|
|
cp -a /usr/share/Jackett/.config/.mono /var/lib/jackett/
|
2018-03-19 18:09:32 +01:00
|
|
|
echo "Copied mono configs from /usr/share/Jackett/.config/.mono -> /var/lib/jackett/"
|
2018-03-13 23:03:44 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2018-03-18 20:45:34 +01:00
|
|
|
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
|
2018-03-19 18:09:32 +01:00
|
|
|
|
|
|
|
if [[ -d /usr/share/Jackett/ ]]; then
|
|
|
|
echo "Remove /usr/share/Jackett if everything is working correctly from /var/lib/jackett now."
|
|
|
|
fi
|
2015-06-20 03:56:05 +02:00
|
|
|
}
|