Files
playit-agent/build-scripts/nfpm/preremove.sh
T
Patrick Lorio a2fd41e185 Add init-manager aware Linux packaging
- Package systemd and OpenRC service files from one nfpm config
- Detect the active init system in postinstall and install the matching service
- Route `linux/playit` through the chosen manager when present
2026-06-04 12:07:05 -07:00

48 lines
790 B
Bash
Executable File

#!/bin/sh
set -eu
have_command() {
command -v "$1" >/dev/null 2>&1
}
is_upgrade() {
case "${1:-}" in
upgrade|upgrading|1)
return 0
;;
*)
return 1
;;
esac
}
if is_upgrade "${1:-}"; then
exit 0
fi
if have_command systemctl; then
systemctl stop playit || true
systemctl disable playit || true
fi
if have_command rc-service; then
rc-service playit stop || true
fi
if have_command rc-update; then
rc-update del playit default || true
fi
rm -f /lib/systemd/system/playit.service
rm -f /usr/lib/systemd/system/playit.service
rm -f /etc/init.d/playit
rm -f /opt/playit/share/init/selected-manager
if [ -L /usr/local/bin/playit ]; then
rm -f /usr/local/bin/playit
fi
if [ -L /usr/local/bin/playitd ]; then
rm -f /usr/local/bin/playitd
fi