summaryrefslogtreecommitdiffstats
path: root/abs/core-testing
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2009-03-23 17:52:48 (GMT)
committerJames Meyer <james.meyer@operamail.com>2009-03-23 17:52:48 (GMT)
commit286c64a9a729bef4412e6f743c49adbbc28593fb (patch)
treefd7574c847fd41fec7933dfa60d6c1a2964a1a62 /abs/core-testing
parent05ffc3f453b01d3e014874db800f574343d48de0 (diff)
downloadlinhes_pkgbuild-286c64a9a729bef4412e6f743c49adbbc28593fb.zip
linhes_pkgbuild-286c64a9a729bef4412e6f743c49adbbc28593fb.tar.gz
linhes_pkgbuild-286c64a9a729bef4412e6f743c49adbbc28593fb.tar.bz2
LinHES-config: Add logic to account for "helpful" DNS returning results for hostnames that do not exisit.
Diffstat (limited to 'abs/core-testing')
-rw-r--r--abs/core-testing/LinHES-config/PKGBUILD2
-rwxr-xr-xabs/core-testing/LinHES-config/install_proxy.sh29
2 files changed, 26 insertions, 5 deletions
diff --git a/abs/core-testing/LinHES-config/PKGBUILD b/abs/core-testing/LinHES-config/PKGBUILD
index ef2fa4d..cabc674 100644
--- a/abs/core-testing/LinHES-config/PKGBUILD
+++ b/abs/core-testing/LinHES-config/PKGBUILD
@@ -1,6 +1,6 @@
pkgname=LinHES-config
pkgver=1.0
-pkgrel=343
+pkgrel=344
conflicts=(MythVantage-config MythVantage-config-dev LinHES-config-dev )
pkgdesc="Install and configure your system"
depends=(bc libstatgrab mysql-python expect curl dnsutils parted sg3_utils nmbscan system-templates )
diff --git a/abs/core-testing/LinHES-config/install_proxy.sh b/abs/core-testing/LinHES-config/install_proxy.sh
index 824c76e..c73b860 100755
--- a/abs/core-testing/LinHES-config/install_proxy.sh
+++ b/abs/core-testing/LinHES-config/install_proxy.sh
@@ -647,8 +647,17 @@ echo "-----------------------------------------------------------------------3--
#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`
+ hout=`host $hostname|head -n1`
status=$?
+ hoip=`echo $hout|awk '{print $4}'`
+ if [ $hoip = found: ]
+ then
+ status=1
+ fi
+
+ unkownhost=`host unkown.linhes.org |head -n1 `
+ unkownhostip=`echo $unkownhost |awk '{print $4}'`
+
#found host, now grab the ip
if [ $status = 0 ]
then
@@ -656,11 +665,23 @@ echo "-----------------------------------------------------------------------3--
/sbin/ifconfig -a |grep -q $hoip
if [ $? = 0 ]
then
- echo "DNS ip matches on of my ips"
+ echo "DNS ip matches on of my ips $hoip"
status=0
else
- echo "IP in DNS but doesn't match mine, hostname is not safe to use"
- status=7
+ if [ $unkownhostip = $hoip ]
+ then
+ echo "Bad DNS returning false hits"
+ echo "Assuming hostname is OK"
+ echo "DNS unknown: $unkownhostip"
+ echo " HOSTDNS: $hoip "
+ /sbin/ifconfig -a |grep "inet addr"
+ else
+ echo "IP in DNS but doesn't match mine, hostname is not safe to use"
+ echo "DNS:$hoip"
+ echo "HOST: "
+ /sbin/ifconfig -a |grep "inet addr"
+ status=7
+ fi
fi
else
echo "Couldn't find hostname in DNS, must be safe to use"