2 # -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
3 # vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
5 # This file contains functions shared between ninjahelper and backupninja.
7 #####################################################
11 # create a temporary file in a secure way.
14 local tempfile=`mktemp /tmp/$1.XXXXXXXX`
18 #####################################################
19 ## CONFIG-FILE RELATED FUNCTIONS
25 function setsection() {
30 # sets a global var with name equal to $1
31 # to the value of the configuration parameter $1
36 ret=`@AWK@ -f $libdirectory/parseini S=$CURRENT_SECTION P=$CURRENT_PARAM $CURRENT_CONF_FILE`
37 # if nothing is returned, set the default
38 if [ "$ret" == "" -a "$2" != "" ]; then
42 # replace * with %, so that it is not globbed.
43 ret="${ret//\\*/__star__}"
45 # this is weird, but single quotes are needed to
46 # allow for returned values with spaces. $ret is still expanded
47 # because it is in an 'eval' statement.