From: intrigeri Date: Tue, 29 Nov 2005 10:09:43 +0000 (+0000) Subject: r3560@krups: intrigeri | 2005-11-15 15:13:35 +0100 X-Git-Tag: backupninja-0.9.2~54 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=285f38ac3154898fcc63d21a1eace97c851356d5;p=matthijs%2Fupstream%2Fbackupninja.git r3560@krups: intrigeri | 2005-11-15 15:13:35 +0100 backupninja now uses the maketemp function shared in lib/tools, instead of its own one. --- diff --git a/src/backupninja.in b/src/backupninja.in index 8f7bd03..2663457 100755 --- a/src/backupninja.in +++ b/src/backupninja.in @@ -130,22 +130,6 @@ function setsection() { } -# -# 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 @@ -488,6 +472,9 @@ if [ ! -d "$configdirectory" ]; then fatal "Configuration directory '$configdirectory' not found." fi +# include shared functions +. $libdir/tools + [ -f "$logfile" ] || touch $logfile if [ "$UID" != "0" ]; then diff --git a/src/ninjahelper.in b/src/ninjahelper.in index 099a580..5d6bdd9 100755 --- a/src/ninjahelper.in +++ b/src/ninjahelper.in @@ -187,6 +187,7 @@ if [ ! -r "$conffile" ]; then echo "Configuration file $conffile not found." exit 1 fi + # find $scriptdir scriptdir=`grep scriptdirectory $conffile | awk '{print $3}'` if [ -z "$scriptdir" ]; then @@ -202,6 +203,7 @@ else exit 1 fi fi + # find $libdir libdir=`grep libdirectory $conffile | awk '{print $3}'` if [ -z "$libdir" ]; then