All pastes #631010 Raw Edit

Vermischtes

public text v1 · immutable
#631010 ·published 2007-07-23 17:17 UTC
rendered paste body
##### /etc/config/testconfig

config testconfig
        option testvar 'abc'


##### /etc/init.d/testconfig

#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=11

. /etc/functions.sh
. /lib/config/uci.sh

start_service () {
        local section="$1"
        config_get testvar "$section" testvar

        echo $testvar

        uci_set "$section" "testvar" "foobar"
}

start () {
        config_load "testconfig"
        config_foreach start_service testconfig
        uci_commit
}


##### /etc/init.d/testconfig && uci show testconfig

abc
testconfig.cfg1=testconfig
testconfig.cfg1.testvar=abc