node_exporter: Use real tempfile
This commit is contained in:
parent
c2a39ecc56
commit
b6bceb64a4
1 changed files with 4 additions and 3 deletions
|
@ -15,9 +15,10 @@ fi
|
|||
for script in /usr/local/libexec/node-exporter/*; do
|
||||
[ -x "$script" ] || continue
|
||||
target="${OUTDIR}/$(basename "$script")"
|
||||
if "$script" > "${target}.tmp" ; then
|
||||
mv "${target}.tmp" "${target}.prom"
|
||||
tmpfile="$(mktemp -p "$OUTDIR")"
|
||||
if "$script" > "$tmpfile" ; then
|
||||
mv "$tmpfile" "$target"
|
||||
else
|
||||
rm -f "${target}.tmp"
|
||||
rm -f "$tmpfile"
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Add table
Reference in a new issue