#!/bin/sh
# postrm script for procps
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <postrm> `remove'
#        * <postrm> `purge'
#        * <old-postrm> `upgrade' <new-version>
#        * <new-postrm> `failed-upgrade' <old-version>
#        * <new-postrm> `abort-install'
#        * <new-postrm> `abort-install' <old-version>
#        * <new-postrm> `abort-upgrade' <old-version>
#        * <disappearer's-postrm> `disappear' <overwriter>
#          <overwriter-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

restoreoldconffile()
{
  v=$1
  f=/etc/init.d/procps
  c=1:3.2.7-5
  [ ! -e "$f" ] && return
  dpkg --compare-versions "$1" ge "$c" || return
  mv "$f" "$f.sh"
}

case "$1" in
    abort-upgrade)
	  restoreoldconffile
	;;
    purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
    ;;

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

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

# Automatically added by dh_installinit/13.24.2ubuntu1
if [ "$1" = "remove" ] && [ -x "/etc/init.d/procps" ] ; then
	chmod -x "/etc/init.d/procps" >/dev/null || true
fi
if [ -z "$DPKG_ROOT" ] && [ "$1" = "purge" ] ; then
	update-rc.d procps remove >/dev/null
fi
# End automatically added section
# Automatically added by dh_installdeb/13.24.2ubuntu1
dpkg-maintscript-helper rm_conffile /etc/sysctl.conf 2:4.0.4-7\~ -- "$@"
dpkg-maintscript-helper mv_conffile /etc/sysctl.d/10-bufferbloat.conf /usr/lib/sysctl.d/55-bufferbloat.conf 2:4.0.4-8ubuntu1\~ -- "$@"
dpkg-maintscript-helper mv_conffile /etc/sysctl.d/10-console-messages.conf /usr/lib/sysctl.d/55-console-messages.conf 2:4.0.4-8ubuntu1\~ -- "$@"
dpkg-maintscript-helper mv_conffile /etc/sysctl.d/10-ipv6-privacy.conf /usr/lib/sysctl.d/55-ipv6-privacy.conf 2:4.0.4-8ubuntu1\~ -- "$@"
dpkg-maintscript-helper mv_conffile /etc/sysctl.d/10-kernel-hardening.conf /usr/lib/sysctl.d/55-kernel-hardening.conf 2:4.0.4-8ubuntu1\~ -- "$@"
dpkg-maintscript-helper mv_conffile /etc/sysctl.d/10-magic-sysrq.conf /usr/lib/sysctl.d/55-magic-sysrq.conf 2:4.0.4-8ubuntu1\~ -- "$@"
dpkg-maintscript-helper mv_conffile /etc/sysctl.d/10-map-count.conf /usr/lib/sysctl.d/55-map-count.conf 2:4.0.4-8ubuntu1\~ -- "$@"
dpkg-maintscript-helper mv_conffile /etc/sysctl.d/10-network-security.conf /usr/lib/sysctl.d/55-network-security.conf 2:4.0.4-8ubuntu1\~ -- "$@"
dpkg-maintscript-helper mv_conffile /etc/sysctl.d/10-ptrace.conf /usr/lib/sysctl.d/55-ptrace.conf 2:4.0.4-8ubuntu1\~ -- "$@"
dpkg-maintscript-helper mv_conffile /etc/sysctl.d/10-qemu.conf /usr/lib/sysctl.d/55-qemu.conf 2:4.0.4-8ubuntu1\~ -- "$@"
dpkg-maintscript-helper mv_conffile /etc/sysctl.d/10-zeropage.conf /usr/lib/sysctl.d/55-zeropage.conf 2:4.0.4-8ubuntu1\~ -- "$@"
# End automatically added section


exit 0


