xmpp-resolve: smarter SRV search

This commit is contained in:
2013-10-06 00:28:34 +03:00
parent 7339c3e981
commit 56ccad80ba
+5 -5
View File
@@ -31,16 +31,16 @@ function print_host() {
for role in client server; do
echo "--- $role ---------------------------------------------"
HOST_ANSWER=$(host -t SRV "_xmpp-$role._tcp.$ADDR" $DNS_SERVER | grep -Ev "$EXTRA_LINES_EXPR")
if echo $HOST_ANSWER | grep -q 'not found'; then
if echo $HOST_ANSWER | grep -q 'has SRV'; then
echo "$HOST_ANSWER" | awk '{ print $7, $8 }' | while read port server; do
print_host $server $port SRV
done
else
if [ "$role" = "server" ]; then
port=5269
else
port=5222
fi
print_host $ADDR $port
else
echo "$HOST_ANSWER" | awk '{ print $7, $8 }' | while read port server; do
print_host $server $port SRV
done
fi
done