--- freem-mk-debian-package/debian/postrm 2025/04/03 01:57:47 1.1 +++ freem-mk-debian-package/debian/postrm 2025/04/04 02:47:52 1.2 @@ -1,6 +1,24 @@ -#!/usr/bin/bash +#!/bin/bash +. /usr/share/debconf/confmodule -userdel freem -groupdel freem +db_input high freem/remove_userdata || false +db_go +db_get freem/remove_userdata +if [[ "$RET" == "true" ]] +then + rm -rf /etc/freem /var/freem > /dev/null +fi + +db_get freem/users_for_group +for FREEM_USER in $RET +do + echo "Removing user ${FREEM_USER} from group 'freem'..." + usermod -rG freem ${FREEM_USER} &> /dev/null +done + +userdel freem &> /dev/null +groupdel freem &> /dev/null + +#DEBHELPER# exit 0