#!/bin/sh
# The enable symlink ships in the package (honored on next boot), so image builds need no
# action here. On a LIVE system (the §7.3 apt-install conversion path), pick the unit up and
# start it now. Guarded on a running systemd so it is a no-op inside the mmdebstrap chroot.
set -e
if [ "$1" = "configure" ] && [ -d /run/systemd/system ]; then
  systemctl daemon-reload || true
  systemctl enable --now nucleic-linux-agent.service || true
fi
exit 0
