#!/bin/sh /etc/rc.common

START=99
USE_PROCD=1
PROG=/usr/bin/remote-board
DEBUG_OUTOUT=1


rb_echo() {
    if [ "$DEBUG_OUTOUT" -gt 0 ]; then
            echo "${1}: ""$2"> /dev/console
    fi
}

start_service() {

    local interface
    local lan_mac

    config_load network

    config_get interface remote ifname "inf.4092"
    config_get lan_mac lan macaddr
    config_clear

    ifconfig $interface hw ether $lan_mac up

    rb_echo remote-board "start remote-board"

    procd_open_instance
    procd_set_param command $PROG -i "$interface"
    procd_set_param respawn
    procd_close_instance

}

stop_service(){
    rb_echo remote-board "stop remote-board"
}

reload_service() {
    stop
    start
}
