#!/bin/sh
OPTS=""

if [ -n "$D" ]; then
    OPTS="--root=$D"
fi

if type systemctl >/dev/null 2>/dev/null; then
	if [ -z "$D" ]; then
		systemctl daemon-reload
	fi

	systemctl $OPTS enable bfvcheck.service

	if [ -z "$D" -a "enable" = "enable" ]; then
		systemctl --no-block restart bfvcheck.service
	fi
fi
