continue 2;
}
- fstf=/tmp/`basename $f`.node$n
+ fstf=$tmpdir/`basename $f`.node$n
onnode $n cat $f > $fstf 2>&1
echo " ================================"
first=false
else
echo "Testing for same config file $f on node $n"
- tmpf=/tmp/`basename $f`.node$n
+ tmpf=$tmpdir/`basename $f`.node$n
onnode $n cat $f > $tmpf 2>&1
diff $diff_opts $fstf $tmpf >/dev/null 2>&1 || {
error "File $f is different on node $n"
done
}
-ERRORS="/tmp/diag_err.$$"
+if ! tmpdir=$(mktemp -d) ; then
+ echo "Unable to create a temporary directory"
+ exit 1
+fi
+ERRORS="${tmpdir}/diag_err"
NUM_ERRORS=0
cat <<EOF
cat $ERRORS
rm -f $ERRORS
}
+
+rm -rf "$tmpdir"
+
exit $NUM_ERRORS