StunCaddsies/test.sh

36 lines
817 B
Bash
Executable File

#! /bin/bash
addr="${1:-${addr:-"192.168.0.86:8080/vpntor"}}"
pport="${2:-${pport:-20018}}"
proxycacert="--proxy-cacert ./mnt/stunserver.crt"
if ((pport==20018)); then
prox="${3:-${prox:-https://localhost}}"
else
prox="${3:-${prox:-http://localhost}}"
fi
if [ "$badcert" ]; then
client="--proxy-key ./mnt/badstunclient.key --proxy-cert ./mnt/badstunclient.crt"
elif [ "$nocert" ]; then
true
elif [ "$clientkey" ] && [ "$clientcrt" ] && [ "$servercrt" ]; then
client="--proxy-key $clientkey --proxy-cert $clientcrt"
proxycacert="--proxy-cacert $servercrt"
else
client="--proxy-key ./mnt/stunclient.key --proxy-cert ./mnt/stunclient.crt"
fi
echo curl -v \
$proxycacert \
$client \
-x $prox:$pport \
$addr
curl -v \
$proxycacert \
$client \
-x $prox:$pport \
$addr