summaryrefslogtreecommitdiff
path: root/debian/acmetool.postrm
diff options
context:
space:
mode:
Diffstat (limited to 'debian/acmetool.postrm')
-rw-r--r--debian/acmetool.postrm34
1 files changed, 34 insertions, 0 deletions
diff --git a/debian/acmetool.postrm b/debian/acmetool.postrm
new file mode 100644
index 0000000..d6f4120
--- /dev/null
+++ b/debian/acmetool.postrm
@@ -0,0 +1,34 @@
+#!/bin/sh
+# postrm script for acmetool
+
+set -e
+
+if [ "$1" = "purge" ] ; then
+ if [ -f "/etc/cron.d/acmetool" ]; then
+ rm -f /etc/cron.d/acmetool
+ if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+ invoke-rc.d cron reload || true
+ else
+ /etc/init.d/cron reload || true
+ fi
+ fi
+
+ if [ -d "/usr/lib/acme/hooks/" ]; then
+ for hook in /usr/lib/acme/hooks/*; do
+ grep -q '#!acmetool-managed!#' "$hook" && rm -f "$hook" || true
+ done
+ rmdir --ignore-fail-on-non-empty /usr/lib/acme/hooks || true
+ fi
+
+ if [ -d "/var/lib/acme" ]; then
+ echo "**************************************************************************************"
+ echo "* the acmetool state directory will be kept, if you want to really delete all your *"
+ echo "* certificates and configurations you need to remove it manually using the following *"
+ echo "* command: rm -rf /var/lib/acme *"
+ echo "**************************************************************************************"
+ fi
+fi
+
+#DEBHELPER#
+
+exit 0