pdns error handling added

Esse commit está contido em:
Dirk Alders 2023-04-04 07:48:41 +02:00
commit 737597bf3b
2 arquivos alterados com 14 adições e 5 exclusões

Ver arquivo

@ -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

Ver arquivo

@ -1,5 +1,8 @@
#/bin/sh
#/bin/bash
#
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