diff options
Diffstat (limited to 'abs/core/LinHES-config/install_proxy.sh')
-rwxr-xr-x | abs/core/LinHES-config/install_proxy.sh | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/abs/core/LinHES-config/install_proxy.sh b/abs/core/LinHES-config/install_proxy.sh index 2449874..c2a450d 100755 --- a/abs/core/LinHES-config/install_proxy.sh +++ b/abs/core/LinHES-config/install_proxy.sh @@ -137,14 +137,18 @@ case $1 in #if host is found, then check to see if it's online #if hoip matchs my ip assume it's ok echo "network check my hostname $hostname" - hout=`host $hostname|head -n1` + echo "Check of hostname with host: $hout" + host $hostname status=$? + + hout=`host $hostname|head -n1` hoip=`echo $hout|awk '{print $4}'` if [ $hoip = found: ] then status=1 fi + if [ $hoip = "out;" ] then #;; connection timed out; no servers could be reached @@ -152,8 +156,11 @@ case $1 in status=1 fi - unkownhost=`host unkown.linhes.org |head -n1 ` - unkownhostip=`echo $unkownhost |awk '{print $4}'` + if [ $status = 0 ] + then + unkownhost=`host unkown.linhes.org |head -n1 ` + unkownhostip=`echo $unkownhost |awk '{print $4}'` + fi #found host, now grab the ip if [ $status = 0 ] |