]> git.ipfire.org Git - people/stevee/network.git/commitdiff
Add documentation about the config options.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 31 May 2012 23:43:59 +0000 (23:43 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 31 May 2012 23:43:59 +0000 (23:43 +0000)
functions.cli
functions.config
functions.constants
functions.hook
functions.zone
man/Makefile
man/network-config.8.in [new file with mode: 0644]

index e2148d6d54752816b6bd0dbbd6bd7049bf7d215e..a9d8be516127d2c23c24dd2b6a6d487a48fbfc1f 100644 (file)
@@ -21,7 +21,7 @@
 
 function cli_config() {
        if cli_help_requested $@; then
-               cli_show_man network
+               cli_show_man network-config
                exit ${EXIT_OK}
        fi
 
index 6544a3db0174e1a0fc2ed73274fc752a8ea74f66..a0d58dd0a51f6f778fbea55951ff0d985625ec74 100644 (file)
@@ -27,6 +27,7 @@ function config_read_globals() {
 
 function config_read() {
        local config_file=${1}
+       assert isset config_file
 
        if [ -e "${config_file}" ]; then
                . ${config_file}
@@ -36,6 +37,7 @@ function config_read() {
 
 function config_write() {
        local config_file=${1}
+       assert isset config_file
        shift
 
        # Check if all values to be written are sane
@@ -95,7 +97,7 @@ function network_config_read() {
        # Save state of DEBUG and restore it later.
        local debug=${DEBUG}
 
-       config_read ${CONFIG_FILE}
+       config_read ${NETWORK_CONFIG_FILE}
 
        if [ -n "${debug}" ]; then
                DEBUG=${debug}
@@ -103,7 +105,7 @@ function network_config_read() {
 }
 
 function network_config_write() {
-       config_write ${CONFIG_FILE} ${CONFIG_FILE_PARAMS}
+       config_write ${NETWORK_CONFIG_FILE} ${CONFIG_FILE_PARAMS}
 }
 
 function network_config_print() {
index 6acee038df45185edd583d011af707ecfd0685b1..6b33e8664dda110b2d3c326f9a1c6d9074f685b7 100644 (file)
@@ -25,18 +25,20 @@ TEXTDOMAIN="network"
 # Enable colors by default
 COLOURS="auto"
 
-BASE_DIR=/usr/lib/network
-CONFIG_DIR=/etc/network
-HOOKS_DIR=${BASE_DIR}/hooks
 LOG_DIR=/var/log/network
 RUN_DIR=/run/network
-ZONE_DIR=${CONFIG_DIR}
 
 RED_RUN=${RUN_DIR}/red
 PPP_SECRETS=/etc/ppp/secrets
 
-CONFIG_FILE=${CONFIG_DIR}/network_config
-CONFIG_FILE_PARAMS="COLOURS DEBUG SHELL TIMEOUT_RESTART"
+# Network directory configuration.
+NETWORK_CONFIG_DIR="/etc/network"
+NETWORK_ZONE_DIR="${NETWORK_CONFIG_DIR}"
+NETWORK_HOOKS_DIR=/usr/lib/network/hooks
+
+# Network file configuration.
+NETWORK_CONFIG_FILE=${NETWORK_CONFIG_DIR}/config
+NETWORK_CONFIG_FILE_PARAMS="COLOURS DEBUG"
 CONFIG_HOSTNAME="/etc/hostname"
 
 RED_DB_DIR=${RUN_DIR}/red
@@ -92,7 +94,7 @@ IPTABLES_TMPDIR=
 
 FIREWALL_CONFIG_DIR="/etc/firewall"
 FIREWALL_ZONES_DIR="${FIREWALL_CONFIG_DIR}/zones"
-FIREWALL_CONFIG_FILE="${FIREWALL_CONFIG_DIR}/settings"
+FIREWALL_CONFIG_FILE="${FIREWALL_CONFIG_DIR}/config"
 FIREWALL_CONFIG_PORTFW="${FIREWALL_CONFIG_DIR}/portfw"
 
 FIREWALL_CONFIG_PARAMS=""
index d193266d14857844c01c5bce64e91f17267fc32c..9a1f3523035da0cc391335a5a4689527fde34e14 100644 (file)
@@ -26,7 +26,7 @@ function hook_dir() {
                type="/${type}s"
        fi
 
-       echo "${HOOKS_DIR}${type}"
+       echo "${NETWORK_HOOKS_DIR}${type}"
 }
 
 function hook_exists() {
index 50dd9ccc22a23da6b3f5b998c3f39c81756f86df..433275cd042dfc1e386f38380fe94fbc8eb2c72c 100644 (file)
@@ -22,9 +22,7 @@
 function zone_dir() {
        local zone=${1}
 
-       #assert isset zone
-
-       echo "${ZONE_DIR}/zones/${zone}"
+       echo "${NETWORK_ZONE_DIR}/zones/${zone}"
 }
 
 function zone_exists() {
index 65b1a6031d30805601e4c2808e6f53ae2288f1ff..23ee47492b52ea81205f5fec4d4e5fcafc230c3c 100644 (file)
@@ -27,6 +27,7 @@ MANPAGES_IN = $(foreach file,$(MANPAGES),$(file).in)
 
 MANPAGES8   = \
        network.8 \
+       network-config.8 \
        network-zone.8
 
 .PHONY: all
diff --git a/man/network-config.8.in b/man/network-config.8.in
new file mode 100644 (file)
index 0000000..bbaa2ba
--- /dev/null
@@ -0,0 +1,43 @@
+.TH network-config 8 "1 Jun 2012" "@VERSION@" "network man page"
+
+.SH NAME
+network-config \- A list of global configuration options.
+
+.SH SYNOPSIS
+\fBnetwork [OPTIONS] config\fR \- Will return a list of all possible keys and their current values.
+.P
+\fBnetwork [OPTIONS] config [KEY=VALUE ...]\fR \- Will set the variable \fBKEY\fR to \fBVALUE\fR.
+
+.SH DESCRIPTION
+The \fBnetwork config\fR command may be used to set global configuration options permanently.
+These options are mostly display options or debugging settings and do not influcence
+the behaviour of the networking code itself.
+
+.SH OPTIONS
+This is a list of possible configuration values:
+
+\fBCOLORS\fR = [\fBauto\fR|on|off]
+.RS 4
+This will control the output of the console tools. \fBon\fR will enable colorful output
+all the time, \fBoff\fR will disable colors.
+.PP
+The default setting is \fBauto\fR which will automatically detect if the console supports
+colors.
+.PP
+Colorful output is very helpful to spot important information faster.
+.RE
+.PP
+
+\fBDEBUG\fR = [\fB0\fR|1]
+.RS 4
+The \fBDEBUG\fR will control weather debug logging is enabled or not. Additionally
+to writing debug log messages to the log files, the messages will displayed on the
+console.
+.RE
+.PP
+
+.SH SEE ALSO
+network(8)
+
+.SH AUTHOR
+Michael Tremer (michael.tremer@ipfire.org)