OSDN Git Service

debian: add postinst/prerm file for newslash-prometheus-exporter
authorhylom <hylom@users.sourceforge.jp>
Fri, 20 Oct 2017 09:24:58 +0000 (18:24 +0900)
committerhylom <hylom@users.sourceforge.jp>
Fri, 20 Oct 2017 09:24:58 +0000 (18:24 +0900)
debian/newslash-prometheus-exporter.postinst [new file with mode: 0644]
debian/newslash-prometheus-exporter.prerm [new file with mode: 0644]

diff --git a/debian/newslash-prometheus-exporter.postinst b/debian/newslash-prometheus-exporter.postinst
new file mode 100644 (file)
index 0000000..873c0ff
--- /dev/null
@@ -0,0 +1,40 @@
+#! /bin/sh
+# postinst script for slash
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+#
+
+case "$1" in
+    configure)
+      systemctl daemon-reload
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+    ;;
+
+    *)
+      echo "postinst called with unknown argument \`$1'" >&2
+      exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/newslash-prometheus-exporter.prerm b/debian/newslash-prometheus-exporter.prerm
new file mode 100644 (file)
index 0000000..41447d7
--- /dev/null
@@ -0,0 +1,28 @@
+#! /bin/sh
+# postinst script for slash
+#
+# see: dh_installdeb(1)
+
+set -e
+
+case "$1" in
+    remove|upgrade)
+      systemctl stop newslash-prometheus-exporter
+    ;;
+
+    deconfigure|failed-upgrade)
+
+    ;;
+
+    *)
+      echo "postinst called with unknown argument \`$1'" >&2
+      exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0