#!/bin/sh

error_arguments ()
{
    echo "ERROR: Missing or invalid arguments."
    exit 1
}

if [ -z "$1" ]
then
    error_arguments
fi

case $1 in
    stop)
        /etc/init.d/timed_reboot countdown &
        ;;
    countdown)
        sleep 15
        echo "--- FORCED REBOOT ---"
        /etc/init.d/restart start
        ;;
    *)
        error_arguments
esac

exit 0

