#!/bin/sh
#
# Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident	"@(#)postremove.tmpl	1.2	03/12/11 SMI"
#

#
# Copyright (c) 2000 by Sun Microsystems, Inc.
# All rights reserved.
#
# ident	"@(#)proc.inetd_usrpostrem	1.2	02/08/08 SMI"
#

# proc.inetd_usrpostrem -- common code for inetd.conf entry removal
#
# inetd_slay	: call after package has been removed

inetd_slay() {
	signal=
	case X$1 in
	X-*)	signal="$1"; shift;;
	esac

	if [ "${PKG_INSTALL_ROOT:-/}" = "/" ]; then
		for i in "$@"; do
			case X$signal in
			X)	;;
			*)	# allow for a soft shutdown
				pkill $signal -x -u 0 "$i"
				sleep 5 ;;
			esac
			pkill -9 -x -u 0 "$i"
		done
	fi
	return 0
}

