If you manage a debian package, you sometimes need to restart a service after the setup. It’s generally done in the postinst script. But sometimes you didn’t have change configuration files and you don’t want to restart the service.
Here a simple example where postinst script will check if configuration files have changed and restart service only when necessary.
In this example, my package contains virtual hosts for apache server. I will make a md5sum of the files before the setup of my new version of the package.