pdns error handling added
This commit is contained in:
parent
bfe1e14475
commit
737597bf3b
10
pdns-get
10
pdns-get
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user