#!/bin/bash # vim: set sts=2 sw=2 et tw=0 : # HOST="http://localhost:8000" caps="application/x-rtp, media=(string)video" start_port=5004 end_port=5018 udp_clients="localhost:$start_port" set -e add_tokens() { local id for port in $(seq $((start_port)) $end_port); do id=$(date +%H%M%S)-$RANDOM curl -s -X POST "$HOST/add-token?sessionid=$id&type=http,rtp-udp&udp-clients=localhost:$port" done } list_tokens() { curl -s -X GET "$HOST/list-tokens" echo } revoke_tokens() { local id list_sessionids | while read id; do curl -s -X DELETE "$HOST/revoke-token?sessionid=$id" done } list_tokens