mirror of
https://github.com/nealey/docker-storcli-prometheus
synced 2025-01-13 02:14:58 -07:00
Atomic write
This commit is contained in:
parent
a687b2d9d6
commit
e24aed7d3a
1 changed files with 2 additions and 1 deletions
|
@ -6,8 +6,9 @@ usage() {
|
|||
[ $# -eq 2 ] || usage
|
||||
trap 'kill -TERM $child 2>/dev/null' SIGTERM
|
||||
while true; do
|
||||
python /storcli.py > "$1" &
|
||||
python /storcli.py > "$1.$$" &
|
||||
child=$!; wait $child
|
||||
mv "$1.$$" "$1"
|
||||
sleep "$2" &
|
||||
child=$!; wait $child
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue