#!/bin/sh
set -e

# Remove shutdown and reboot links; this init script does not need them.
if dpkg --compare-versions "$2" lt "5.38+svn2879-1"; then
	if [ -e /etc/rc0.d/K20smartmontools ]; then
		rm -f /etc/rc0.d/K20smartmontools
	fi
	if [ -e /etc/rc6.d/K20smartmontools ]; then
		rm -f /etc/rc6.d/K20smartmontools
	fi
fi

dpkg-maintscript-helper rm_conffile \
	/etc/init.d/smartd 6.1+svn3812-1~ smartmontools -- "$@" 

# Automatically added by dh_installinit
if [ -x "/etc/init.d/smartmontools" ] || [ -e "/etc/init/smartmontools.conf" ]; then
	if [ ! -e "/etc/init/smartmontools.conf" ]; then
		update-rc.d smartmontools start 20 2 3 4 5 . stop 20 1 . >/dev/null
	fi
	invoke-rc.d smartmontools start || exit $?
fi
# End automatically added section

