From owner-freebsd-questions@FreeBSD.ORG Mon May 23 00:30:07 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7B3B916A41F for ; Mon, 23 May 2005 00:30:07 +0000 (GMT) (envelope-from phusion2k@gmail.com) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id 13D3443D48 for ; Mon, 23 May 2005 00:30:06 +0000 (GMT) (envelope-from phusion2k@gmail.com) Received: by rproxy.gmail.com with SMTP id b11so845371rne for ; Sun, 22 May 2005 17:30:06 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=bayFfnImHHzbVhnmgOG7iOWuL6vWmbfb8UUAtWEVT1dfUhA4q2/NYze3Nz4EHzEHiUWxOZX6jTSnp0EDJoIXzJLJ/odkiY2J/8QZRogPp9dRa/77vGRHszxy0GWDAnAlouXK8/Ci+8k1LiRO5u4cLiU1QT/GN6V1vzgY3SJXe/w= Received: by 10.11.122.5 with SMTP id u5mr35892cwc; Sun, 22 May 2005 17:30:06 -0700 (PDT) Received: by 10.11.100.43 with HTTP; Sun, 22 May 2005 17:30:06 -0700 (PDT) Message-ID: Date: Sun, 22 May 2005 19:30:06 -0500 From: Phusion To: freebsd-questions@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: Help with Expect X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Phusion List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2005 00:30:07 -0000 I need some help with an expect script I'm trying to write. Here's what I would like to do. - Ping the host to see if it's up. a. If the host responds to pings telnet into it. b. If the host doesn't respond to pings write that to a log file and close the expect script properly. The host does respond to pings. I was thinking if I see a ttl in the response packet to assume it's up and telnet into it. Let me know how I can do the following with expect. Also, how do I close an expect script properly? Thanks.