#!/bin/sh
# Before removing the .deb (prerm remove) or the .rpm (%preun 0): the system services are
# stopped and disabled. An upgrade leaves them as they are.
set -e
case "$1" in
  remove | 0) ;;
  *) exit 0 ;;
esac
if [ -d /run/systemd/system ]; then
  systemctl disable --now verityrf.service verityrf-observer.service >/dev/null 2>&1 || true
fi
exit 0
