Import debian packages for silc-client, silc-server and silc-toolkit
[silc.git] / debian-silc-server / postrm
diff --git a/debian-silc-server/postrm b/debian-silc-server/postrm
new file mode 100644 (file)
index 0000000..8b25a35
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+set -e
+
+CONFIGDIR="/etc/silcd"
+CONFIGFILE="$CONFIGDIR/silcd.conf"
+IPCONFIGFILE="$CONFIGDIR/silcd-primary-ip.conf"
+ADMINCONFIGFILE="$CONFIGDIR/silcd-admin.conf"
+
+case "$1" in
+    purge)
+        if [ -d /var/log/silcd ]; then
+            rm -rf /var/log/silcd
+        fi
+
+        # Remove conffile from ucf's database if ucf is available
+        if [ -x /usr/bin/ucf ]; then
+            for conffile in "$CONFIGFILE" "$IPCONFIGFILE" "$ADMINCONFIGFILE"; do
+                ucf --purge "$conffile"
+            done
+
+        fi
+
+        # Remove silcd configuration directory
+        rm -rf "$CONFIGDIR"
+        ;;
+
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+        ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+
+# vim: et sw=4