#! /bin/sh

PAUSE="10"

test -t 1 && echo "Sending SIGTERM to bhyve processes."
/usr/bin/killall -TERM bhyve

test -t 1 && echo -n "Waiting for processes to exit ... "
while /usr/bin/killall -0 bhyve >/dev/null 2>&1
do
	sleep "${PAUSE}"
done
test -t 1 && echo "done."

exit 0
