]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
avoid using host
authorSam Hartman <hartmans@debian.org>
Fri, 2 Aug 2002 21:31:36 +0000 (21:31 +0000)
committerSam Hartman <hartmans@debian.org>
Fri, 2 Aug 2002 21:31:36 +0000 (21:31 +0000)
debian/openafs-client.postinst

index b16f8a1905f5073c1dfbd9663bc296114fe60b1d..fec53387c00a3f08bb3a5af9c922d53fdaf8ac52 100644 (file)
@@ -38,11 +38,10 @@ case "$1" in
            db_get openafs-client/cell-info
            if [ "x$RET" != "x" ] ; then
                echo \>$THISCELL >/etc/openafs/CellServDB.new
-               for hname in $RET ; do 
-                   host $hname |perl -anle \
-                     'print "$F[2] # $F[0]" if $F[1] eq "A"' \
-                     >>/etc/openafs/CellServDB.new
-                   done
+               perl -MSocket -e 'foreach (@ARGV) {' \
+                       -e '@a=gethostbyname($_) and ' \
+                       -e 'printf("%s\t\t# %s\n",inet_ntoa($a[4]),$a[0]) }' $RET \
+                   >>/etc/openafs/CellServDB.new
                        if [ `wc -l </etc/openafs/CellServDB.new` -eq 1 ] ; then
                            echo None of the hostnames resolved to an address 2>&1
                            db_reset openafs-client/cell-info ||true