pdns error handling added

This commit is contained in:
Dirk Alders 2023-04-04 07:48:41 +02:00
parent bfe1e14475
commit 737597bf3b
2 changed files with 14 additions and 5 deletions

View File

@ -1,4 +1,10 @@
#!/bin/sh #!/bin/bash
# #
wget -O - stdout http://pdns.mount-mockery.de 2> /dev/null|jq .$1 IP=`wget -O - stdout http://pdns.mount-mockery.de 2> /dev/null|jq .$1`
if [[ "$IP" = "null" ]]; then
echo No IP found for host $1.
exit 1
else
echo $IP
fi

View File

@ -1,5 +1,8 @@
#/bin/sh #/bin/bash
# #
HOST=`pdns-get $1` HOST=`pdns-get $1`
socat stdio tcp:$HOST:22 if [[ $? -eq 0 ]]; then
socat stdio tcp:$HOST:22
else
>&2 echo CONNECTION ERROR: IP of host $1 is unknown.
fi