#!/bin/sh /etc/rc.common
#set -x
START=20

uci2onoff() {
    case "$1" in
        0) echo "off";;
        1) echo "on";;
        *) echo "Invalid UCI enable option: $1" 1>&2; echo "on";;
    esac
}

setup_eee() {
    config_get eee ethernet eee 1
    pwrctl config --eee `uci2onoff $eee`
}

setup_autogreeen() {
    config_get autogreeen ethernet autogreeen 1
    pwrctl config --autogreeen `uci2onoff $autogreeen`
}

setup() {
    config_load power
    setup_autogreeen
    setup_eee
}

start() {
    setup
}


