post_install() { systemd-sysusers sickrage.conf systemd-tmpfiles --create sickrage.conf chown -R sickrage:sickrage /opt/sickrage echo "==> Configuration files have moved to /opt/sickrage/data. To migrate, run the following commands as root and then reinstall:" echo " systemctl stop sickrage.service" echo " pacman -Rn sickrage-git" echo " cp -a /opt/sickrage{,.bak}" echo ' rm -r $(ls -1d /opt/sickrage/* | grep -Ev "/backup.*|/cache.*|/config.ini.*|/Log.*|/.*\.db.*")' echo " mkdir -p /opt/sickrage/data" echo " mv /opt/sickrage/* /opt/sickrage/data/" echo "==> Start and enable sickrage.service. Then visit http://localhost:8081/" echo "==> If an upgrade fails with \"error: failed to commit transaction (conflicting files)\", then uninstall first." } post_upgrade() { post_install $1 } pre_remove() { systemctl stop sickrage.service } post_remove() { rm -rf /opt/sickrage/app echo "==> To delete the configuration files, run as root: rm -rf /opt/sickrage/data" # Do not delete the 'sickrage' user automatically. It may still own files. # If 'sickrage' is the only user in group 'sickrage', then userdel will also delete the group. echo "==> To delete the \"sickrage\" user, run as root: userdel --force sickrage" }