Path: utzoo!utgpu!watserv1!watmath!att!linac!uwm.edu!spool.mu.edu!samsung!umich!sharkey!cfctech!rphroy!trux!car From: car@trux.UUCP (Chris Rende) Newsgroups: comp.protocols.tcp-ip Subject: Testing if a host is up Message-ID: <529@trux.UUCP> Date: 15 Feb 91 18:34:50 GMT Organization: Central Cartage, Sterling Hgts., MI Lines: 31 I have a shell script which does a FTP of a file over to another host. I need a way to put a test ahead of the FTP that will determine whether or not the other host is "up". Here is what I have so far: -------------------------------------------------------------------- # hostup - Written 01/30/91 by Chris Rende # Last change: 01/30/91 by Chris Rende x=`ping HOST 56 1 | fgrep packets | cut -c24` if [ $x = 0 ]; then echo "HOST is down" exit 1 fi echo "HOST is up" exit 0 -------------------------------------------------------------------- Is there a better way? (I.e., more robust, less kludgy). C program(s) welcome. car. -- Christopher A. Rende Central Cartage (Nixdorf/Pyramid/SysVR2/BSD4.3) uunet!edsews!rphroy!trux!car Multics,DTSS,Unix,Shortwave,Scanners,UnixPC/3B1 trux!car@uunet.uu.net Minix 1.2,PC/XT,Mac+,TRS-80 Model I,1802 ELF trux!ramecs!car "I don't ever remember forgetting anything." - Chris Rende