#! /bin/sh
### BEGIN INIT INFO
# Provides:		rc-local
# Required-Start:	network sysklogd pkgsrc-rc.d-boot
# Should-Start:		console
# Required-Stop:	pkgsrc-rc.d-boot
# Should-Stop:
# Default-Start:	2 3 4 5
# Default-Stop:		0 1 6
# Short-Description: Run /etc/rc.local if it exist
### END INIT INFO


PREFIX="@PREFIX@"
export PATH="/sbin:/usr/sbin:/bin:/usr/bin"
export PATH="${PREFIX}/sbin:${PREFIX}/bin:${PATH}"

. /lib/lsb/init-functions

do_start() {
	if [ -x /etc/rc.local ]; then
		/etc/rc.local start
		ES=$?
		return $ES
	fi
}

do_stop() {
	if [ -x /etc/rc.local ]; then
		/etc/rc.local stop
		ES=$?
		return $ES
	fi
}

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