2 # Shell script for interacting with config files
4 # Copyright (C) 2006 by Fokus Fraunhofer <carsten.tittel@fokus.fraunhofer.de>
5 # Copyright (C) 2006 by Felix Fietkau <nbd@openwrt.org>
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34 config_get
"$CONFIG" "$OPTION"
62 [ $# -ne 3 -a $# -ne 2 ] && {
78 [ $# -gt 2 -o $# -lt 1 ] && {
88 if [ -z "$CONFIG" -o "$CONFIG" = "$2" ]; then
91 append
"${CONFIG_SECTION}_VARS" "$1"
102 for section
in $SECTION; do
103 config_get
type "$section" TYPE
104 [ -z "$type" ] && continue
105 echo "@$section=$type"
106 eval "VARS=\"\${${section}_VARS}\""
108 config_get val
"$section" "$var"
110 echo "${section}.${var}=${val}"
111 config_set
"$section" "$var" ""
114 config_set
"$section" TYPE
""
120 show
) echo "$0 show <package> [<config>]";;
121 get
) echo "$0 get <package> <config> <option>";;
122 set) echo "$0 set <package> <config> <option> <value>";;
123 add
) echo "$0 add <package> <type> <config>";;
124 del
) echo "$0 del <package> <config> [<option>]";;
125 rename
) echo "$0 rename <package> <config> <name>";;
126 commit
) echo "$0 commit <package>";;
128 echo "Syntax: $0 <command> <arguments...>"
143 if [ $# -eq 0 ] ; then
152 del
) do_remove
"$@";;
153 rename
) do_rename
"$@";;
156 commit
) do_commit
"$@";;
This page took 0.051488 seconds and 5 git commands to generate.