#!/bin/sh 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\///' curl "http://localhost:8000/${SESSION}" OUT=$(sudo tcpdump -i wlan0 -n -c 1 port 443 2>/dev/null) FROM=$(echo "$OUT" |awk '{ print $3 }' |sed 's/\.[0-9]\+//') TO=$(echo "$OUT" |awk '{ print $5 }' |sed 's/\.[0-9]\+://') while true; do curl -XPOST -H 'Content-Type: application/json' "http://127.0.0.1:8000${SESSION}/links" -d "{ \"from\": \"${FROM}\", \"to\": \"${TO}\", \"label\": \"${OUT}\" }" echo "${FROM} -> ${TO}" sleep 1 done