#!/bin/sh
set -e

case "$1" in
    purge)
        rm -rf /var/lib/openlist
        rm -rf /etc/openlist

        # systemd-sysusers users are usually not removed on uninstall; only
        # clean up when the user was created manually (non-systemd).
        if [ ! -d /run/systemd/system ] && getent passwd openlist >/dev/null; then
            deluser --system openlist 2>/dev/null || true
        fi
        ;;
esac

#DEBHELPER#

exit 0
