#!/bin/sh

post_install() {
	echo " > For instructions visit: https://github.com/eworm-de/pacredir#usage"
}

pre_upgrade() {
	# return if old package version greater 0.4...
	(( $(vercmp $2 '0.4') > 0 )) && return

	# upgrade from pre-0.4 version, pacdbserve.service no longer exists
	if systemctl is-enabled -q pacdbserve.service; then
		systemctl disable -q pacdbserve.service
	fi
}

post_upgrade() {
	# return if old package version greater 0.4...
	(( $(vercmp $2 '0.4') > 0 )) && return

	# upgrade from pre-0.4 version, avahi service names changed
	echo " > This upgrade from pacredir $2 to pacredir $1 changes avahi service"
	echo " > names. Make sure to update all your installations for compatibility."
}
