]> mj.ucw.cz Git - libucw.git/blob - ucw/shell/libucw.sh
Merge branch 'master' into dev-opt
[libucw.git] / ucw / shell / libucw.sh
1 # The UCW Library -- Shell Functions
2 # (c) 2005 Martin Mares <mj@ucw.cz>
3 #
4 # This software may be freely distributed and used according to the terms
5 # of the GNU Lesser General Public License.
6
7 UCW_CF=
8 while [ "${1:0:2}" = "-C" -o "${1:0:2}" = "-S" ] ; do
9         if [ -z "${1:2:1}" ] ; then
10                 UCW_CF="$UCW_CF $1 $2"
11                 shift 2
12         else
13                 UCW_CF="$UCW_CF $1"
14                 shift 1
15         fi
16 done
17
18 function log # msg
19 {
20         bin/ucw-logger $UCW_PROGNAME I "$1"
21 }
22
23 function errlog # msg
24 {
25         bin/ucw-logger $UCW_PROGNAME E "$1"
26 }
27
28 function warnlog # msg
29 {
30         bin/ucw-logger $UCW_PROGNAME E "$1"
31 }
32
33 function die # msg
34 {
35         bin/ucw-logger $UCW_PROGNAME ! "$1"
36         exit 1
37 }
38
39 function parse-config # section vars...
40 {
41         eval `bin/ucw-config$UCW_CF "$@"`
42 }