User Tools

Site Tools


pages:scripts:testtextrecord

testtextrecord

#!/bin/bash
# Erster Parameter: Gewuenschter RDNS-Eintrag
# Zweiter Parameter: Von Vodafone vorgegebener Authentifizierungsstring
#
# Aufruf:
# ./testtxtrecord.sh <HOSTNAME.DOMAIN.TLD> <AUTHSTRING>

REVDNSRECORD="$1";
AUTHSTRING="$2";
DOMAIN=$(echo "$REVDNSRECORD" | cut -d"." -f2,3);
AUTHORITATIVENS=$(dig SOA +noall +answer $DOMAIN | awk '{ print $5 }' | rev | cut -c 2- | rev );
dig +noall +answer -t txt "@$AUTHORITATIVENS" "$DOMAIN" | grep "$AUTHSTRING" && echo "OK" || echo "NOT OK";

./testtxtrecord.sh calvin10.wiretrip.de YweIdum3Gyt2qOzYU44Q

wiretrip.de.            43166   IN      TXT     "YweIdum3Gyt2qOzYU44Q"
OK
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
pages/scripts/testtextrecord.txt · Last modified: 2022/12/31 02:03 by Heiko Mischer