#!/bin/sh
set -e

. /usr/share/debconf/confmodule

case "$1" in
    purge)
        command -v ucf >/dev/null && ucf --purge /etc/opt/slapos/slapos.cfg

        rm -rf /var/opt/slapos/ /etc/opt/slapos/ /opt/slapos/
        echo "Note: purging slapos-node removed the configuration files and the logs. If you want to also remove the data, run 'rm -rf /opt/slapgrid /srv/slapgrid'."
     ;;

     remove)
         rm -rf /opt/slapos/
      ;;

esac

#DEBHELPER#
