#!/bin/sh

set -e

# Stop the socket on remove so fcgiwrap is not restarted via socket activation
if [ -d /run/systemd/system ] && [ "$1" = remove ] ; then
	systemctl stop fcgiwrap.socket || true
fi

# Automatically added by dh_installsystemd/13.11.4
if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
	deb-systemd-invoke stop 'fcgiwrap.service' 'fcgiwrap.socket' >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installinit/13.11.4
if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -x "/etc/init.d/fcgiwrap" ] ; then
	invoke-rc.d --skip-systemd-native fcgiwrap stop || exit 1
fi
# End automatically added section

