#!/bin/sh -e

if [ "$1" = "purge" ] && [ -d /usr/lib/openvas/plugins ]; then
  echo ""
  echo "The /usr/lib/openvas/plugins directory still exists."
  echo "This might be because you downloaded additional plugins into it"
  echo "when using a previous Nessus version."
  echo -n "Do you want to remove the full directory now? "
  read ANSWER
  case $ANSWER in
    [yY]*) rm -rf /usr/lib/openvas/plugins ;;
  esac
fi

if [ "$1" = "purge" ] && [ -d /var/lib/openvas/plugins ]; then
  echo ""
  echo "The /var/lib/openvas/plugins directory still exists."
  echo "This might be because you downloaded additional plugins into it."
  if [ -d /var/lib/openvas/plugins/.desc ]; then
  echo "Or because the openvasd package was not fully purged."
  fi
  echo ""
  echo -n "Do you want to remove the full directory now? "
  read ANSWER
  case $ANSWER in
    [yY]*) rm -rf /var/lib/openvas/plugins ;;
  esac
fi

#DEBHELPER#

exit 0
