summaryrefslogtreecommitdiffstats
path: root/docs/config.tex
diff options
context:
space:
mode:
authorpavlov <pavlov@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-11-06 23:37:55 +0000
committerpavlov <pavlov@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-11-06 23:37:55 +0000
commitd9219238b05cc37112dd11427581e1aa6b502b33 (patch)
tree16795db1eb0b5a75512b7d4560d30da29139f44c /docs/config.tex
parent495294a4dfd42f71e2fde24a652d56e7f8da6375 (diff)
some basic cleanup, stylistic change for config files, and slight fixes
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5455 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'docs/config.tex')
-rw-r--r--docs/config.tex22
1 files changed, 11 insertions, 11 deletions
diff --git a/docs/config.tex b/docs/config.tex
index acb4bdf85..f3802198e 100644
--- a/docs/config.tex
+++ b/docs/config.tex
@@ -9,25 +9,25 @@ it was written under.
Syntax:
\begin{Verbatim}
-config <type> [<name>] # Section
- option <name> <value> # Option
+config <type> ["<name>"] # Section
+ option <name> "<value>" # Option
\end{Verbatim}
Every parameter needs to be a single string and is formatted exactly
-like a parameter for a shell function. The same rules for Quoting and
+like a parameter for a shell function. The same rules for Quoting and
special characters also apply, as it is parsed by the shell.
\subsubsection{Parsing configuration files in custom scripts}
-To be able to load configuration files, you need to include the common
+To be able to load configuration files, you need to include the common
functions with:
\begin{Verbatim}
. /etc/functions.sh
\end{Verbatim}
-Then you can use \texttt{config\_load \textit{<name>}} to load config files. The function
-first checks for \textit{<name>} as absolute filename and falls back to loading
+Then you can use \texttt{config\_load \textit{<name>}} to load config files. The function
+first checks for \textit{<name>} as absolute filename and falls back to loading
it from \texttt{/etc/config} (which is the most common way of using it).
If you want to use special callbacks for sections and/or options, you
@@ -36,13 +36,13 @@ need to define the following shell functions before running \texttt{config\_load
\begin{Verbatim}
config_cb() {
- local type="$1"
- local name="$2"
- # commands to be run for every section
+ local type="$1"
+ local name="$2"
+ # commands to be run for every section
}
option_cb() {
- # commands to be run for every option
+ # commands to be run for every option
}
\end{Verbatim}
@@ -68,7 +68,7 @@ config_get <variable> <section> <option> # stores the value inside the variable
In busybox ash the three-option \texttt{config\_get} is faster, because it does not
result in an extra fork, so it is the preferred way.
-Additionally you can also modify or add options to sections by using the
+Additionally you can also modify or add options to sections by using the
\texttt{config\_set} command.
Syntax: