#! /bin/sh
### BEGIN INIT INFO
# Provides:          autohdmi
# Required-Start:    $all
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
### END INIT INFO

DESC="Freescale autohdmi utility"

PATH=/sbin:/usr/sbin:/bin:/usr/bin

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

case "$1" in
    start)
        log_daemon_msg "Starting $DESC"
        export DISPLAY=:0
        rm -f /core
        autohdmi &
        log_end_msg 0
        exit 0
        ;;

    reload|force-reload)
        echo "Error: argument '$1' not supported" >&2
        exit 3
        ;;

    stop)
        echo -n "Shutting down autohdmi: "
        killproc autohdmi
        rm -f /core
        ;;

    restart)
        log_daemon_msg "Restarting $DESC"
        $0 stop
        $0 start
        log_end_msg 0
        ;;
    *)
        echo "Usage: $0 start|stop" >&2
        exit 3
        ;;
esac
