navidrome/release/linux/preremove.sh
Kendall Garner 154e13f7c9
build: add packages for deb and rpm to release (#3202)
* support packing deb/rpm/archlinux

* .-.

* initial test

* fix postinstall, remove execstop

* bash -> sh, create toml manually if it doesn't exist (thanks debian)

* don't forget that newline

* postrm

* comments, contrib -> packaging/linux

* contrib > packaging in .goreleaser

* actually add toml

* openrc/sysv templates

* add apk. nothing else yet

* wait, we have a ntive uninstall

* fix: merge errors, move packaging to release

* chore: remove old goreleaser conf

* ci: remove `release` dependency on `docker push`

* ci: fix release version

* ci: upload packages

* ci: try to fix json file list

* ci: replace the json file list with a txt artifact

* postremove -> preremove, skip install/remove error

* actually do preremove

* better preremove

* ci: fix

* ci: fix?

* ci: clean-up

* ci: try to change labels and filenames

* ci: fix?

* ci: fix?

* ci: add `make package` target

* ci: make labels more readable

hope it doesn't break the pipeline again

* build: remove alpine and archlinux packages, for now.

---------

Co-authored-by: Deluan <deluan@navidrome.org>
2024-10-26 13:31:45 -04:00

30 lines
825 B
Bash

#!/bin/sh
action=$1
remove() {
postinstall_flag="/var/lib/navidrome/.installed"
if [ -f "$postinstall_flag" ]; then
# If this fails, ignore it
navidrome service uninstall || :
rm "$postinstall_flag"
printf "The following may still be present (especially if you have not done a purge):\n"
printf "1. /etc/navidrome/navidrome.toml (configuration file)\n"
printf "2. /var/lib/navidrome (database/cache)\n"
printf "3. /opt/navidrome (default location for music)\n"
printf "4. The Navidrome user (user name navidrome)\n"
fi
}
case "$action" in
"1" | "upgrade")
# For an upgrade, do nothing
# Leave the service file untouched
# This is relevant for RPM/DEB-based installs
;;
*)
remove
;;
esac