#!/bin/sh

set -eu

RULES=/etc/udev/rules.d/99-lava-dispatcher-host.rules

# The postinst only installs the rules when udevadm is already available at the
# point the package is configured, which apt does not guarantee here, so
# install them explicitly
lava-dispatcher-host rules install

test -f "${RULES}"
grep -q "lava-dispatcher-host" "${RULES}"

# lava-docker-worker.service must be installed, but not enabled by default
systemctl cat lava-docker-worker.service
! systemctl is-active lava-docker-worker.service
