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

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

# Source function library.
. /etc/init.d/functions

case "$1" in
    start)
	echo -n "Starting autohdmi: "
	export DISPLAY=:0
	autohdmi &
	echo
	exit 0
        ;;
    reload|force-reload)
        echo "Error: argument '$1' not supported" >&2
        exit 3
        ;;
    stop)
        echo -n "Shutting down autohdmi: "
        killproc autohdmi
        echo
        ;;
    restart)
        echo -n "Restarting autohdmi: "
        $0 stop
        $0 start
	echo
        ;;
    *)
        echo "Usage: $0 start|stop" >&2
        exit 3
        ;;
esac
