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
|
for script in /usr/local/libexec/node-exporter/*; do
|
||||||
[ -x "$script" ] || continue
|
[ -x "$script" ] || continue
|
||||||
target="${OUTDIR}/$(basename "$script")"
|
target="${OUTDIR}/$(basename "$script")"
|
||||||
if "$script" > "${target}.tmp" ; then
|
tmpfile="$(mktemp -p "$OUTDIR")"
|
||||||
mv "${target}.tmp" "${target}.prom"
|
if "$script" > "$tmpfile" ; then
|
||||||
|
mv "$tmpfile" "$target"
|
||||||
else
|
else
|
||||||
rm -f "${target}.tmp"
|
rm -f "$tmpfile"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue