#!/bin/sh

set -e

case "$1" in
    remove)
        update-alternatives --remove ovs-vswitchd /usr/lib/openvswitch-switch/ovs-vswitchd

        if [ -x /usr/lib/openvswitch-switch/ovs-vswitchd-dpdk ]; then
            update-alternatives --remove ovs-vswitchd /usr/lib/openvswitch-switch/ovs-vswitchd-dpdk
        fi
        ;;

    deconfigure|upgrade|failed-upgrade)
        ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
        ;;
esac


# Automatically added by dh_installinit/13.6ubuntu1
if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -x "/etc/init.d/openvswitch-switch" ] ; then
	invoke-rc.d openvswitch-switch stop || exit 1
fi
# End automatically added section
# Automatically added by dh_systemd_start/13.6ubuntu1
if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
	deb-systemd-invoke stop 'ovs-record-hostname.service' >/dev/null || true
fi
# End automatically added section


exit 0

