#!/bin/sh
# Stop all instances cleanly when incus-startup.service stops, but only
# if the daemon is actually running (activateifneeded may have left it off).

if ! systemctl -q is-active incus.service; then
	exit 0
fi

exec /usr/libexec/incus/incusd shutdown
