1#!/bin/sh
2
3# Abort on error.
4set -e
5
6if [ -x /usr/sbin/update-initramfs -a \
7	-e /etc/initramfs-tools/initramfs.conf ]; then
8    update-initramfs -u
9fi
10
11#DEBHELPER#
12
13# debhelper doesn't know what timers are...
14update_svc() {
15	deb-systemd-helper unmask "$1" >/dev/null || true
16
17	if deb-systemd-helper --quiet was-enabled "$1"; then
18		deb-systemd-helper enable "$1" >/dev/null || true
19	else
20		deb-systemd-helper update-state "$1" >/dev/null || true
21	fi
22}
23update_svc e2scrub_all.timer
24update_svc e2scrub_reap.service
25
26# Start our new services
27if [ -d /run/systemd/system ]; then
28	systemctl --system daemon-reload >/dev/null || true
29	deb-systemd-invoke start e2scrub_all.timer >/dev/null || true
30fi
31
32exit 0
33