#! /bin/sh
### BEGIN INIT INFO
# Provides:          sendsigs
# Required-Start:    
# Required-Stop: 
# Default-Start:     6
# Default-Stop:       
# Short-Description: Kill all remaining processes.
# Description: 
### END INIT INFO
#
# Version:      @(#)sendsigs  2.85-8  05-Nov-2003  miquels@cistron.nl
#

PATH=/sbin:/bin:/usr/sbin:/usr/bin
. /lib/lsb/init-functions

do_stop () {
    # Kill all processes.
    log_action_begin_msg "Terminating any remaining processes"
    killall5 -15
    sleep 5
    killall5 -9
    log_action_end_msg 0
}

splash_back() {
    # Restore usplash
    for x in $(cat /proc/cmdline); do
	case $x in
	splash*)
	    SPLASH=true;
	    ;;
	esac
    done

    [ "$SPLASH" = "true" ] || return 0

    if [ -x /sbin/usplash ]; then
        /sbin/usplash -c &
    fi
}

case "$1" in
    start)
        ;;
    restart|reload|force-reload)
        echo "Error: argument '$1' not supported" >&2
        exit 3
        ;;
    stop)
        do_stop
	splash_back
        ;;
    *)
        echo "Usage: $0 start|stop" >&2
        exit 3
        ;;
esac

: exit 0
