#!/bin/sh
# Begin $rc_base/init.d/sendsignals - Sendsignals Script

# Based on sendsignals script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

. /etc/sysconfig/rc
. $rc_functions

case "$1" in
	stop)
		echo "Sending all processes the TERM signal..."
		killall5 -15
		error_value=$?

		sleep $KILLDELAY

		if [ "$error_value" = 0 ]
		then
			print_status success
		else
			print_status failure
		fi

		echo "Sending all processes the KILL signal..."
		killall5 -9
		error_value=$?

		sleep $KILLDELAY

		if [ "$error_value" = 0 ]
		then
			print_status success
		else
			print_status failure
		fi
		;;

	*)
		echo "Usage: $0 {stop}"
		exit 1
		;;

esac

# End $rc_base/init.d/sendsignals
