docker-storcli-prometheus/entrypoint.sh

15 lines
325 B
Bash
Raw Permalink Normal View History

2018-05-18 12:39:17 -06:00
#!/bin/bash
usage() {
echo "usage: $0 <output_file> <interval>"
exit 2
}
[ $# -eq 2 ] || usage
trap 'kill -TERM $child 2>/dev/null' SIGTERM
while true; do
2018-05-18 13:03:16 -06:00
python /storcli.py --storcli_path=/usr/sbin/storcli > "$1.$$" &
2018-05-18 12:39:17 -06:00
child=$!; wait $child
2018-05-18 12:49:51 -06:00
mv "$1.$$" "$1"
2018-05-18 12:39:17 -06:00
sleep "$2" &
child=$!; wait $child
done