2 # Copyright (C) 2006 OpenWrt.org
3 # Copyright (C) 2006 Fokus Fraunhofer <carsten.tittel@fokus.fraunhofer.de>
5 alias debug
=${DEBUG:-:}
14 env
-i ACTION
=$1 INTERFACE
=$2 /sbin
/hotplug net
22 eval "export -n -- \"$var=\${$var:+\${$var}\${value:+\$sep}}\$value\""
26 config_cb
() { return 0; }
27 option_cb
() { return 0; }
35 CONFIG_NUM_SECTIONS
=$
(($CONFIG_NUM_SECTIONS + 1))
36 name
="${name:-cfg$CONFIG_NUM_SECTIONS}"
37 append CONFIG_SECTIONS
"$name"
38 config_cb
"$cfgtype" "$name"
39 CONFIG_SECTION
="$name"
40 export -n "CONFIG_${CONFIG_SECTION}_TYPE=$cfgtype"
44 local varname
="$1"; shift
47 export -n "CONFIG_${CONFIG_SECTION}_${varname}=$value"
48 option_cb
"$varname" "$*"
57 [ "$OLD" -a "$NEW" ] ||
return
58 for oldvar
in `set | grep ^CONFIG_${OLD}_ | \
59 sed -e 's/\(.*\)=.*$/\1/'` ; do
60 newvar
="CONFIG_${NEW}_${oldvar##CONFIG_${OLD}_}"
61 eval "export -n \"$newvar=\${$oldvar}\""
64 CONFIG_SECTIONS
="$(echo " $CONFIG_SECTIONS " | sed -e "s
, $OLD , $NEW ,")"
66 [ "$CONFIG_SECTION" = "$OLD" ] && CONFIG_SECTION
="$NEW"
70 config_set
"$1" "$2" ""
77 CONFIG_SECTIONS
="$(echo " $CONFIG_SECTIONS " | sed -e "s
, $OLD , ,")"
78 CONFIG_SECTIONS
="${SECTION:+$CONFIG_SECTIONS}"
80 for oldvar
in `set | grep ^CONFIG_${SECTION:+$SECTION_} | \
81 sed -e 's/\(.*\)=.*$/\1/'` ; do
87 local file="/etc/config/$1"
97 ${CONFIG_SECTION:+config_cb}
102 "") eval "echo \"\${CONFIG_${1}_${2}}\"";;
103 *) eval "export -n -- \"$1=\${CONFIG_${2}_${3}}\"";;
111 export -n "CONFIG_${section}_${option}=$value"
118 [ -z "$CONFIG_SECTIONS" ] && return 0
119 for section
in ${CONFIG_SECTIONS}; do
120 eval "$function \"\$section\""
126 sed 's/^[^#]/insmod &/' $
* | ash
2>&- ||
:
132 for file in $
(ls $1/*.sh
2>/dev
/null
); do
138 local PART
="$(grep "\"$1\"" /proc/mtd | awk -F: '{print $1}')"
141 echo "${PART:+/dev/mtdblock/$PART}"
144 strtok
() { # <string> { <variable> [<separator>] ... }
151 while [ $# -gt 1 ]; do
154 [ "$tmp" = "$val" ] && break
158 export -n "$1=$tmp"; count
=$
((count
+1))
162 if [ $# -gt 0 -a "$val" ]; then
163 export -n "$1=$val"; count
=$
((count
+1))
This page took 0.065578 seconds and 5 git commands to generate.