From be6b6122a9e8153956949460e3a4adabe01cc848 Mon Sep 17 00:00:00 2001
From: Michael Biebl <biebl@debian.org>
Date: Thu, 13 Oct 2016 17:59:24 +0200
Subject: [PATCH] dh 10

---
 debian/network-manager.postinst.debhelper | 89 +++++++++++++++++++++++++++++++
 debian/network-manager.postrm.debhelper   | 34 ++++++++++++
 debian/network-manager.prerm.debhelper    | 20 +++++++
 3 files changed, 143 insertions(+)

diff --git a/debian/network-manager.postinst.debhelper b/debian/network-manager.postinst.debhelper
index 8bdeb31..51c7a9f 100644
--- a/debian/network-manager.postinst.debhelper
+++ b/debian/network-manager.postinst.debhelper
@@ -1,3 +1,48 @@
+# Automatically added by dh_systemd_enable
+# This will only remove masks created by d-s-h on package removal.
+deb-systemd-helper unmask NetworkManager-dispatcher.service >/dev/null || true
+
+# was-enabled defaults to true, so new installations run enable.
+if deb-systemd-helper --quiet was-enabled NetworkManager-dispatcher.service; then
+	# Enables the unit on first installation, creates new
+	# symlinks on upgrades if the unit file has changed.
+	deb-systemd-helper enable NetworkManager-dispatcher.service >/dev/null || true
+else
+	# Update the statefile to add new symlinks (if any), which need to be
+	# cleaned up on purge. Also remove old symlinks.
+	deb-systemd-helper update-state NetworkManager-dispatcher.service >/dev/null || true
+fi
+# End automatically added section
+# Automatically added by dh_systemd_enable
+# This will only remove masks created by d-s-h on package removal.
+deb-systemd-helper unmask NetworkManager-wait-online.service >/dev/null || true
+
+# was-enabled defaults to true, so new installations run enable.
+if deb-systemd-helper --quiet was-enabled NetworkManager-wait-online.service; then
+	# Enables the unit on first installation, creates new
+	# symlinks on upgrades if the unit file has changed.
+	deb-systemd-helper enable NetworkManager-wait-online.service >/dev/null || true
+else
+	# Update the statefile to add new symlinks (if any), which need to be
+	# cleaned up on purge. Also remove old symlinks.
+	deb-systemd-helper update-state NetworkManager-wait-online.service >/dev/null || true
+fi
+# End automatically added section
+# Automatically added by dh_systemd_enable
+# This will only remove masks created by d-s-h on package removal.
+deb-systemd-helper unmask NetworkManager.service >/dev/null || true
+
+# was-enabled defaults to true, so new installations run enable.
+if deb-systemd-helper --quiet was-enabled NetworkManager.service; then
+	# Enables the unit on first installation, creates new
+	# symlinks on upgrades if the unit file has changed.
+	deb-systemd-helper enable NetworkManager.service >/dev/null || true
+else
+	# Update the statefile to add new symlinks (if any), which need to be
+	# cleaned up on purge. Also remove old symlinks.
+	deb-systemd-helper update-state NetworkManager.service >/dev/null || true
+fi
+# End automatically added section
 # Automatically added by dh_installinit
 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
 	if [ -x "/etc/init.d/network-manager" ]; then
@@ -11,3 +56,47 @@ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
 	fi
 fi
 # End automatically added section
+# Automatically added by dh_systemd_start
+if [ -d /run/systemd/system ]; then
+	systemctl --system daemon-reload >/dev/null || true
+	if [ -n "$2" ]; then
+		_dh_action=try-restart
+	else
+		_dh_action=start
+	fi
+	deb-systemd-invoke $_dh_action NetworkManager-dispatcher.service >/dev/null || true
+fi
+# End automatically added section
+# Automatically added by dh_systemd_start
+if [ -d /run/systemd/system ]; then
+	systemctl --system daemon-reload >/dev/null || true
+	if [ -n "$2" ]; then
+		_dh_action=try-restart
+	else
+		_dh_action=start
+	fi
+	deb-systemd-invoke $_dh_action NetworkManager-wait-online.service >/dev/null || true
+fi
+# End automatically added section
+# Automatically added by dh_systemd_start
+if [ -d /run/systemd/system ]; then
+	systemctl --system daemon-reload >/dev/null || true
+	if [ -n "$2" ]; then
+		_dh_action=try-restart
+	else
+		_dh_action=start
+	fi
+	deb-systemd-invoke $_dh_action NetworkManager-dispatcher.service >/dev/null || true
+fi
+# End automatically added section
+# Automatically added by dh_systemd_start
+if [ -d /run/systemd/system ]; then
+	systemctl --system daemon-reload >/dev/null || true
+	if [ -n "$2" ]; then
+		_dh_action=try-restart
+	else
+		_dh_action=start
+	fi
+	deb-systemd-invoke $_dh_action NetworkManager-dispatcher.service NetworkManager-wait-online.service >/dev/null || true
+fi
+# End automatically added section
diff --git a/debian/network-manager.postrm.debhelper b/debian/network-manager.postrm.debhelper
index 2f0d06b..c83b11c 100644
--- a/debian/network-manager.postrm.debhelper
+++ b/debian/network-manager.postrm.debhelper
@@ -1,3 +1,23 @@
+# Automatically added by dh_systemd_start
+if [ -d /run/systemd/system ]; then
+	systemctl --system daemon-reload >/dev/null || true
+fi
+# End automatically added section
+# Automatically added by dh_systemd_start
+if [ -d /run/systemd/system ]; then
+	systemctl --system daemon-reload >/dev/null || true
+fi
+# End automatically added section
+# Automatically added by dh_systemd_start
+if [ -d /run/systemd/system ]; then
+	systemctl --system daemon-reload >/dev/null || true
+fi
+# End automatically added section
+# Automatically added by dh_systemd_start
+if [ -d /run/systemd/system ]; then
+	systemctl --system daemon-reload >/dev/null || true
+fi
+# End automatically added section
 # Automatically added by dh_installinit
 if [ "$1" = "purge" ] ; then
 	update-rc.d network-manager remove >/dev/null
@@ -10,3 +30,17 @@ if [ -d /run/systemd/system ] ; then
 	systemctl --system daemon-reload >/dev/null || true
 fi
 # End automatically added section
+# Automatically added by dh_systemd_enable
+if [ "$1" = "remove" ]; then
+	if [ -x "/usr/bin/deb-systemd-helper" ]; then
+		deb-systemd-helper mask NetworkManager-dispatcher.service NetworkManager-wait-online.service NetworkManager.service >/dev/null
+	fi
+fi
+
+if [ "$1" = "purge" ]; then
+	if [ -x "/usr/bin/deb-systemd-helper" ]; then
+		deb-systemd-helper purge NetworkManager-dispatcher.service NetworkManager-wait-online.service NetworkManager.service >/dev/null
+		deb-systemd-helper unmask NetworkManager-dispatcher.service NetworkManager-wait-online.service NetworkManager.service >/dev/null
+	fi
+fi
+# End automatically added section
diff --git a/debian/network-manager.prerm.debhelper b/debian/network-manager.prerm.debhelper
index f74eb50..2d1d005 100644
--- a/debian/network-manager.prerm.debhelper
+++ b/debian/network-manager.prerm.debhelper
@@ -1,3 +1,23 @@
+# Automatically added by dh_systemd_start
+if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
+	deb-systemd-invoke stop NetworkManager-dispatcher.service NetworkManager-wait-online.service >/dev/null
+fi
+# End automatically added section
+# Automatically added by dh_systemd_start
+if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
+	deb-systemd-invoke stop NetworkManager-dispatcher.service >/dev/null
+fi
+# End automatically added section
+# Automatically added by dh_systemd_start
+if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
+	deb-systemd-invoke stop NetworkManager-wait-online.service >/dev/null
+fi
+# End automatically added section
+# Automatically added by dh_systemd_start
+if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
+	deb-systemd-invoke stop NetworkManager-dispatcher.service >/dev/null
+fi
+# End automatically added section
 # Automatically added by dh_installinit
 if [ -x "/etc/init.d/network-manager" ] && [ "$1" = remove ]; then
 	invoke-rc.d network-manager stop || exit $?
-- 
2.9.3

