#!@BASH@
+# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
# This file contains functions shared between ninjahelper and backupninja.
# create a temporary file in a secure way.
#
function maketemp() {
- if [ -x /bin/mktemp ]
- then
- local tempfile=`mktemp /tmp/$1.XXXXXXXX`
- else
- DATE=`date`
- sectmp=`echo $DATE | /usr/bin/md5sum | cut -d- -f1`
- local tempfile=/tmp/$1.$sectmp
- fi
+ local tempfile=`mktemp /tmp/$1.XXXXXXXX`
echo $tempfile
}
#
function getconf() {
CURRENT_PARAM=$1
- ret=`awk -f $libdirectory/parseini S=$CURRENT_SECTION P=$CURRENT_PARAM $CURRENT_CONF_FILE`
+ ret=`@AWK@ -f $libdirectory/parseini S=$CURRENT_SECTION P=$CURRENT_PARAM $CURRENT_CONF_FILE`
# if nothing is returned, set the default
if [ "$ret" == "" -a "$2" != "" ]; then
ret="$2"