#!/bin/sh
#
# $FreeBSD: ports/audio/mt-daapd/files/pkg-deinstall.in,v 1.1 2006/06/25 13:17:25 itetcu Exp $
# formerly $ FreeBSD: ports/audio/mt-daapd/pkg-deinstall,v 1.1 2004/08/05 23:00:09 edwin Exp $
#
 
PATH=/bin:/usr/bin:/usr/sbin
       
case $2 in
       
POST-DEINSTALL)
  echo '---> Starting post-deinstall script:'

  if [ -f /usr/local/etc/mt-daapd.conf ]; then
    echo '---> You seem to have made some custom daapd configuration.'
    echo '--->   The "daapd" user and "daapd" group were therefore not deleted.'
    echo '--->   You may delete them with "pw groupdel daapd; pw userdel daapd".'

  else
    echo '---> Removing group "daapd"'
    /usr/sbin/pw groupdel -n daapd
    echo '---> Removing user "daapd"'
    echo 'y' | /usr/sbin/pw userdel -n daapd
  fi

  ;;

esac
