#!/bin/bash

set -e

if [ "$1" = "purge" ]; then
	if command -v grub-mkconfig > /dev/null
	then
		grub-mkconfig -o /boot/grub/grub.cfg || true
	fi
	rm -f /boot/grub/grub-btrfs.{new,cfg,cfg.bkp}
fi

# Automatically added by dh_installsystemd/13.10.1
if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
	systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installsystemd/13.10.1
if [ "$1" = "purge" ]; then
	if [ -x "/usr/bin/deb-systemd-helper" ]; then
		deb-systemd-helper purge 'grub-btrfs.service' 'kaisen-grub-btrfs-ro.service' >/dev/null || true
	fi
fi
# End automatically added section
