aboutsummaryrefslogtreecommitdiff
path: root/debian/backupninja.preinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/backupninja.preinst')
-rw-r--r--debian/backupninja.preinst32
1 files changed, 32 insertions, 0 deletions
diff --git a/debian/backupninja.preinst b/debian/backupninja.preinst
new file mode 100644
index 0000000..7adc8ed
--- /dev/null
+++ b/debian/backupninja.preinst
@@ -0,0 +1,32 @@
+#!/bin/sh
+set -e
+
+# Remove the erroneous /etc/logrotate.d/backupninja directory if it exists
+
+if [ -d /etc/logrotate.d/backupninja ]
+then
+ rm -f /etc/logrotate.d/backupninja/backupninja
+ rmdir /etc/logrotate.d/backupninja
+ if [ $? -ne 0 ]
+ then
+ cat << EOF
+
+The /etc/logrotate.d/backupninja directory was created incorrectly by an earlier
+version of this package. When trying to remove this directory file(s) were found
+inside this directory. There should be no files in this directory at all.
+Installation of this package will not proceed until you have cleaned this
+directory out.
+
+EOF
+
+ exit 1
+ fi
+fi
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+