#!/bin/sh set -e -u IN_SEQ='' HTTP='' usage() { [ $# -gt 0 ] && echo "ERROR: $1" echo "usage: $0 --in-sequence|--at-once [--use-http]" cat </dev/null 2>>$LOG & PID=$! echo "launched $PID" if [ $IN_SEQ -eq 1 ]; then sleep 9 kill $PID sleep 1 elif [ $IN_SEQ -eq 0 ]; then PIDS="$PIDS $PID" fi done done [ -n "${PIDS}" ] && sleep 10 for PID in $PIDS; do kill $PID done