Import previous packager work.
[packages/xinetd.git] / debian / xinetd.postrm
diff --git a/debian/xinetd.postrm b/debian/xinetd.postrm
new file mode 100644 (file)
index 0000000..a3bb2df
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh -e
+# xinetd postrm
+
+case "$1" in
+  remove)
+    if [ ! -f "/etc/init.d/inetd.real" ]; then
+      echo ""
+      echo "WARNING: you don't have an init script for the original"
+      echo "inetd anymore! You may need to reinstall the netkit-inetd"
+      echo "package to get it back."
+      echo ""
+    fi
+    rm -f /etc/init.d/inetd
+    dpkg-divert --package xinetd --remove --rename --divert \
+                  /etc/init.d/inetd.real /etc/init.d/inetd
+    if [ -f "/etc/init.d/inetd.real" ]; then
+        if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+            invoke-rc.d inetd start
+        elif [ -x /etc/init.d/inetd ]; then
+            /etc/init.d/inetd start
+        fi
+    fi
+    ;;
+  purge)
+    rm -f /etc/xinetd.conf*
+    rm -f /etc/default/xinetd
+    rm -rf /etc/xinetd.d/
+    ;;
+esac
+
+#DEBHELPER#