#!/bin/sh TEMP=/tmp/dnscheck.$$ # Make sure the user has PH so dig can be run later on. if ! expr "$HPUSERCAPF" : '.*PH.*' >/dev/null; then echo You lack PH capability which is required for running this script! exit 1 fi # We don't want SM users running this in order for the security checking to # be meaningful. if expr "$HPUSERCAPF" : '.*SM.*' >/dev/null; then echo Users with SM capability are not allowed to run this script echo because that would render the security checks meaningless! exit 1 fi # We don't want AM users in the SYS account running this either! if [ "$HPACCOUNT" = "SYS" ] && expr "$HPUSERCAPF" : '.*AM.*' >/dev/null; then echo SYS account users with AM capability are not allowed to run this echo script because that would render the security checks meaningless! exit 1 fi # Choose a version of dig to use. if echo "Checking for executable /BINDFW/CURRENT/bin/dig... \c" && [ -x /BINDFW/CURRENT/bin/dig ]; then # the latest from bixby.org echo yes DIG=/BINDFW/CURRENT/bin/dig elif echo "no\nChecking for executable /BINDFW/PUB/bin/dig... \c" && [ -x /BINDFW/PUB/bin/dig ]; then # older from bixby.org echo yes DIG=/BINDFW/PUB/bin/dig elif echo "no\nChecking for executable /BIND/PUB/bin/dig... \c" && [ -x /BIND/PUB/bin/dig ]; then # MPE 6.0 FOS echo yes DIG=/BIND/PUB/bin/dig else echo "no\nUnable to locate an executable copy of the BIND dig utility!" exit 1 fi # Phase II - check DNS for all interfaces? # #callci "file output=$TEMP.nettool,new;save;rec=,,b,ascii;disc=2147483647" #/SYS/NET/NETTOOL "STATUS;NODE;INTERFACES;QUIT" #callci 'reset output' # #eval $(awk '\ #/^Local node name:/ { NODE=$4 } #/^Local node.s domain name:/ { getline; ARPA=$1 } #$0 ~ /^Network Name:/ { NAME=NAME " " $3 } #$0 ~ /^Network Type:/ { TYPE=TYPE " " $3 } #$0 ~ /^IP Address:/ { IP=IP " " $3 } #END { printf "NODENAME=%s; ",NODE; # printf "ARPANAME=%s; ",ARPA; # printf "set -A NETNAME %s; ",NAME; # printf "set -A NETTYPE %s; ",TYPE; # printf "set -A NETIP %s ",IP; }' $TEMP.nettool) # #rm -f $TEMP.* echo "\nObtaining your hostname from /bin/uname -n... \c" UNAME="$(/bin/uname -n | tr A-Z a-z)" if [ "X$UNAME" != "X" ]; then echo $UNAME else echo "failed\n" /bin/cat </dev/null; then echo yes else echo "not found!\n" echo "You are relying on /SYS/NET/HOSTS and may have problems!" fi echo "\n/SYS/NET/RESLVCNF entries:" echo "--------------------------" grep -v ^# /SYS/NET/RESLVCNF echo "--------------------------" echo "\nChecking for the existence of /SYS/NET/HOSTS... \c" if [ -f /SYS/NET/HOSTS ]; then echo yes else echo "no\n" /bin/cat </dev/null; then echo yes else echo "no\n" /bin/cat <$TEMP.diga A=$(awk ' ANSWER == 1 && $4 == "A" { printf "%s\n",$5 } /^$/ { ANSWER = 0 } /ANSWER SECTION/ { ANSWER = 1; next }' $TEMP.diga) if [ "X$A" != "X" ]; then echo yes cat $TEMP.diga else echo "no\n" /bin/cat <$TEMP.digptr PTR=$(awk ' ANSWER == 1 && $4 == "PTR" { printf "%s\n",$5 } /^$/ { ANSWER = 0 } /ANSWER SECTION/ { ANSWER = 1; next }' $TEMP.digptr) if [ "X$PTR" != "X" ] && expr " $PTR " : ".* ${FQDN}[.] .*" >/dev/null; then echo yes cat $TEMP.digptr else echo "no\n" /bin/cat <