summaryrefslogtreecommitdiffstats
path: root/debian/dokuwiki-plugins-extra.prerm
diff options
context:
space:
mode:
Diffstat (limited to 'debian/dokuwiki-plugins-extra.prerm')
-rwxr-xr-xdebian/dokuwiki-plugins-extra.prerm34
1 files changed, 34 insertions, 0 deletions
diff --git a/debian/dokuwiki-plugins-extra.prerm b/debian/dokuwiki-plugins-extra.prerm
new file mode 100755
index 0000000..dc355ff
--- /dev/null
+++ b/debian/dokuwiki-plugins-extra.prerm
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+set -e
+
+case "${1}" in
+ remove|upgrade|deconfigure)
+ DIRECTORIES="$(cd /usr/share/dokuwiki/plugins-extra && ls -d */ | sed -e 's|/$||g')"
+
+ # Removing all plugins
+ for PLUGIN in ${DIRECTORIES}
+ do
+ if [ -L "/var/lib/dokuwiki/lib/plugins/${PLUGIN}" ]
+ then
+ if [ "$(dirname $(readlink /var/lib/dokuwiki/lib/plugins/"${PLUGIN}"))" = "/usr/share/dokuwiki/plugins-extra" ]
+ then
+ rm -f "/var/lib/dokuwiki/lib/plugins/${PLUGIN}"
+ fi
+ fi
+ done
+ ;;
+
+ failed-upgrade)
+
+ ;;
+
+ *)
+ echo "prerm called with unknown argument \`${1}'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0