34 lines
605 B
Bash
Executable file
34 lines
605 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
case "${1}" in
|
|
remove|upgrade|deconfigure)
|
|
DIRECTORIES="$(cd /usr/share/dokuwiki/templates-extra && ls -d */ | sed -e 's|/$||g')"
|
|
|
|
# Removing all templates
|
|
for TEMPLATE in ${DIRECTORIES}
|
|
do
|
|
if [ -L "/var/lib/dokuwiki/lib/tpl/${TEMPLATE}" ]
|
|
then
|
|
if [ "$(dirname $(readlink /var/lib/dokuwiki/lib/tpl/"${TEMPLATE}"))" = "/usr/share/dokuwiki/templates-extra" ]
|
|
then
|
|
rm -f "/var/lib/dokuwiki/lib/tpl/${TEMPLATE}"
|
|
fi
|
|
fi
|
|
done
|
|
;;
|
|
|
|
failed-upgrade)
|
|
|
|
;;
|
|
|
|
*)
|
|
echo "prerm called with unknown argument \`${1}'" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
#DEBHELPER#
|
|
|
|
exit 0
|