#!/bin/sh # postrm script for wims-lti # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' # # for details, see https://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in purge) if [ -e /usr/share/debconf/confmodule ]; then # Source debconf library. . /usr/share/debconf/confmodule # Remove my changes to the db. db_purge fi # disable the website for apache2 and remove the configuration file if ([ -f /usr/sbin/a2dissite ] && [ -f /etc/apache2/sites-enabled/wims-lti-django.conf ]); then a2dissite wims-lti-django; rm -f /etc/apache2/sites-available/wims-lti-django.conf fi # backup the database # create a random temporary file name, without tempfile # ... Why is not debianutils part of piupart's package list? t="$(mktemp --tmpdir=/var/tmp --suffix .sqlite3 wims-lti-XXXXX)" cp /var/lib/wims-lti/db.sqlite3 $t echo "Made a backup of the database in $t" # clean every file left rm -rf /var/lib/wims-lti rm -f /etc/apache2/sites-available/wims-lti-django.conf ;; remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. # Automatically added by dh_installdebconf/13.11.9 if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule db_purge fi # End automatically added section exit 0