r3560@krups: intrigeri | 2005-11-15 15:13:35 +0100
authorintrigeri <intrigeri@758a04ac-41e6-0310-8a23-8373a73cc35d>
Tue, 29 Nov 2005 10:09:43 +0000 (10:09 +0000)
committerintrigeri <intrigeri@758a04ac-41e6-0310-8a23-8373a73cc35d>
Tue, 29 Nov 2005 10:09:43 +0000 (10:09 +0000)
 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

src/backupninja.in
src/ninjahelper.in

index 8f7bd03f39542a1e537cb4e13fcb4850978e5a22..26634576c1b4655650d1963b5ce658378a981104 100755 (executable)
@@ -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
index 099a5808b9086ea426f3dcf35a65094d833c778d..5d6bdd9dae4dc3019821aa9267d6ba5271e090fc 100755 (executable)
@@ -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