summaryrefslogtreecommitdiff
path: root/src/util/parseconf.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/parseconf.sh')
-rw-r--r--src/util/parseconf.sh42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/util/parseconf.sh b/src/util/parseconf.sh
index d215a99..17cb0ce 100644
--- a/src/util/parseconf.sh
+++ b/src/util/parseconf.sh
@@ -1,37 +1,37 @@
#!/bin/sh
usage () {
- printf "Usage $0 "
- echo << "EOF"
+printf "Usage $0 "
+echo << "EOF"
OPTIONS... [FILTER]
Print the parsed config file filtering by the keys
Arguments:
- -f file read configuration from a file, uses /dev/sdtin otherwise
- -v only print values
- -c n print the last [n]
+-f file read configuration from a file, uses /dev/sdtin otherwise
+-v only print values
+-c n print the last [n]
EOF
}
# parse a single config file line
#
parse_line() {
- [ "$#" = 0 ] && return
-
- local line="$@"
- local key=$1
-
- shift
- local value="$@"
- value=${value%#*}
-
- case $key in
- "include")
- cat $value | parse
- return
- ;;
- "]")
- IFS=.
+[ "$#" = 0 ] && return
+
+local line="$@"
+local key=$1
+
+shift
+local value="$@"
+value=${value%#*}
+
+case $key in
+ "include")
+ cat $value | parse
+ return
+ ;;
+ "]")
+ IFS=.
set -- $list
list="${*%${!#}}"
IFS=" "