# systemd-compat-units - postinst
#!/bin/sh
set -e

if [ -n "$D" ]; then
    $INTERCEPT_DIR/postinst_intercept delay_to_first_boot systemd-compat-units mlprefix=
    exit 0
fi

	test -d $D/etc/init.d  ||  exit 0
	cd $D/etc/init.d

	echo "Disabling the following sysv scripts: "

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

	for i in    busybox-udhcpc   hwclock   networking   nfsserver   nfscommon   syslog.busybox  ; do
		if [ -e $i -o -e $i.sh ]  &&   ! [ -e $D/etc/systemd/system/$i.service -o -e $D/usr/lib/systemd/system/$i.service ] ; then
			echo -n "$i: "
			systemctl $OPTS mask $i.service
		fi
	done
	echo