#!/bin/sh

/opt/puppetlabs/server/apps/puppetserver/scripts/install.sh postinst_deb

# On upgrade, we should restart the service if it's running
if [ $1 = 'configure' -a -n $2 ] ; then
  if [ -d '/run/systemd/system' ] ; then
    # Using systemd
    systemctl daemon-reload >/dev/null 2>&1 || :
    systemctl try-restart puppetserver.service ||:
  else
    # Using sysv
    invoke-rc.d puppetserver try-restart || :
  fi
fi
