#!/bin/bash COUNT=${COUNT=10} SLEEP=${SLEEP=1} SESSION=$(curl -XPOST http://localhost:8000/api/new-session -s |jq -r '.uri') echo "Session: ${SESSION}" echo "Frontend: http://localhost:8000/frontend/${SESSION}" |sed 's/\/api\/session\///' while true; do NUM="${RANDOM}" FROM="$(expr ${NUM} + 1)" FROM="node-$(expr $FROM % ${COUNT})" TO="$(expr ${NUM} + 1)" TO="node-$(expr $NUM % ${COUNT})" LABEL="$(date +%H%M%S)" curl -s -o /dev/null -XPOST -H 'Content-Type: application/json' "http://127.0.0.1:8000${SESSION}/links" -d "{ \"from\": \"${FROM}\", \"to\": \"${TO}\", \"label\": \"${LABEL}\" }" sleep ${SLEEP} done