tor_multipath_voip/scripts/container/start_client

59 lines
1.5 KiB
Text
Raw Normal View History

2019-10-22 15:42:20 +00:00
#!/bin/bash
LPORT="${NLINKS:-9000}"
RPORT="${NLINKS:-9000}"
NLINKS="${NLINKS:-16}"
SCHED="${SCHED:-tick_tock=0}"
LOGS="/tmp/donar_log"
mkdir -p $LOGS
echo "[+] Log folder is $LOGS"
tor2 -f /etc/torrc_simple > $LOGS/tor.stdout 2> $LOGS/tor.stderr &
echo "[+] Started Tor"
sleep 2
echo "[+] Please enter links and finish with an empty line"
2019-10-22 16:38:26 +00:00
while read line; do
2019-10-22 15:42:20 +00:00
[ -z "$line" ] && break
echo $line >> onion_services.pub
done
donar \
-a lightning \
-c \
-o onion_services.pub \
-l $NLINKS \
-p $SCHED \
-e $LPORT \
-r $RPORT \
> $LOGS/client-donar-stdout.log 2> $LOGS/client-donar-stderr.log &
echo "[+] Started Donar. Local port is $LPORT, remote port is $RPORT."
gst-launch-1.0 \
autoaudiosrc ! \
webrtcdsp ! \
queue ! \
audioresample ! \
opusenc audio-type=voice inband-fec=FALSE frame-size=40 bitrate=32000 dtx=TRUE ! \
rtpopuspay ! \
udpsink host=127.13.3.7 port=9000 async=FALSE \
udpsrc port=9000 caps="application/x-rtp" ! \
rtpjitterbuffer do-lost=TRUE do-retransmission=FALSE latency=10 ! \
rtpopusdepay ! \
opusdec plc=TRUE use-inband-fec=FALSE ! \
audioresample ! \
webrtcechoprobe ! \
autoaudiosink > $LOGS/gstreamer.stdout 2> $LOGS/gstreamer.stderr &
echo "[+] Started GStreamer"
echo "[+] Waiting for connections"
connections=0
while [ $connections -ne $NLINKS ]; do
sleep 1
connections=$(grep 'Succeeded,' $LOGS/client-donar-stdout.log | wc -l)
2019-10-22 16:38:26 +00:00
echo -ne "Connecting: $connections/$NLINKS\033[0K\r"
2019-10-22 15:42:20 +00:00
done
echo "Ready"
echo "[+] Let's rocks!"
2019-10-22 16:38:26 +00:00
wait