%if %{_systemd_el}
%systemd_postun_with_restart puppetserver.service
%endif
%if %{_systemd_sles}
%service_del_postun puppetserver.service
%endif
%if %{_with_sysvinit}
# Remove the rundir if this is an uninstall (as opposed to an upgrade)...
if [ "$1" = "0" ]; then
    rm -rf %{_app_rundir}
fi

# Only restart it if it is running
if [ "$1" = "1" ] ; then
    /sbin/service %{name} condrestart >/dev/null 2>&1
fi
%endif

