#!/bin/bash

set -e

if [ "$1" = "purge" ] ; then
  #
  #  Remove the linked certificate if we have one, and the associated TLS file.
  #
  if [ -L /etc/ssl/private/pure-ftpd.pem ]; then
    rm /etc/ssl/private/pure-ftpd.pem
    rm -f /etc/pure-ftpd/conf/TLS
  fi

  #
  # And restart pure-ftpd.
  #
  invoke-rc.d pure-ftpd restart 
fi

#DEBHELPER#

exit 0
