Code

control: Added missing plugins to package description.
[pkg-collectd.git] / debian / collectd.postinst
old mode 100755 (executable)
new mode 100644 (file)
index 82cfa51..8fe5048
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
 # postinst script for collectd
 #
 # see: dh_installdeb(1)
@@ -17,32 +17,13 @@ set -e
 # for details, see http://www.debian.org/doc/debian-policy/ or
 # the debian-policy package
 
-. /usr/share/debconf/confmodule
-
-case "$1" in
-    configure)
-        db_get collectd/auto-migrate-3-4
-        if [ "$RET" = "true" ]; then
-            tmpdir=`mktemp -dt collectd.XXXXXXXXXX`
-
-            cp -a /var/lib/collectd/ /var/backups/collectd-"$2"
-            /usr/lib/collectd/utils/migrate-3-4.px -o $tmpdir | bash
-
-            rm -rf /var/lib/collectd/
-            mv $tmpdir /var/lib/collectd/
-        fi
-    ;;
-
-    abort-upgrade|abort-remove|abort-deconfigure)
-    ;;
-
-    *)
-        echo "postinst called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-db_stop
+if [ -x "/etc/init.d/collectd" ]; then
+       if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+               invoke-rc.d collectd restart || exit $?
+       else
+               /etc/init.d/collectd restart || exit $?
+       fi
+fi
 
 # dh_installdeb will replace this with shell code automatically
 # generated by other debhelper scripts.
@@ -51,4 +32,3 @@ db_stop
 
 exit 0
 
-