backupninja now uses the maketemp function shared in lib/tools, instead of its own one.
git-svn-id: http://code.autistici.org/svn/backupninja/trunk@244
758a04ac-41e6-0310-8a23-
8373a73cc35d
}
-#
-# 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
- echo $tempfile
-}
-
-
#
# sets a global var with name equal to $1
# to the value of the configuration parameter $1
fatal "Configuration directory '$configdirectory' not found."
fi
+# include shared functions
+. $libdir/tools
+
[ -f "$logfile" ] || touch $logfile
if [ "$UID" != "0" ]; then
echo "Configuration file $conffile not found."
exit 1
fi
+
# find $scriptdir
scriptdir=`grep scriptdirectory $conffile | awk '{print $3}'`
if [ -z "$scriptdir" ]; then
exit 1
fi
fi
+
# find $libdir
libdir=`grep libdirectory $conffile | awk '{print $3}'`
if [ -z "$libdir" ]; then