From owner-freebsd-questions Sat May 23 01:43:34 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA21822 for freebsd-questions-outgoing; Sat, 23 May 1998 01:43:34 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from lucy.bedford.net (lucy.bedford.net [206.99.145.54]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA21787 for ; Sat, 23 May 1998 01:43:27 -0700 (PDT) (envelope-from listread@lucy.bedford.net) Received: (from listread@localhost) by lucy.bedford.net (8.8.8/8.8.8) id EAA26298; Sat, 23 May 1998 04:42:39 -0400 (EDT) (envelope-from listread) Message-Id: <199805230842.EAA26298@lucy.bedford.net> Subject: Re: PPP Scripting Advice In-Reply-To: <3565F837.1D2EBE9D@mcs.net> from Anthony Kim at "May 22, 98 05:12:07 pm" To: tkim@mcs.net (Anthony Kim) Date: Sat, 23 May 1998 04:42:39 -0400 (EDT) Cc: djv@bedford.net, freebsd-questions@FreeBSD.ORG Reply-to: djv@bedford.net From: CyberPeasant X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Anthony Kim wrote: > Thanks Dave, > > Yeah ip-up, I should have thought of that...here I am trying > everything I can think of in the command line. Doh. > > So I've got the ip address printing to /dev/console > However I can't get something like this to work in ip-up > (if this is do-able) > > TTY=`tty` I bet this comes back with something weird. > IP=$4 > echo IP address is $IP > $TTY > > Obviously what would be nice is the output on /dev/tty??? > instead of /dev/console ... not that this is life threatening > > I've tried > echo IP address is $IP > /tmp/pppd.stuff > cat /tmp/pppd.stuff > $TTY > > but this doesn't work Nope. The problem is that by the time ip-up is called, pppd has gone daemon, and no longer has any tty devices associated with it. fd's 0,1,2 are set to /dev/null for ip-up. You have two options: write to /dev/console use logger (man logger). And a hack: Suppose you start pppd from a script. The script can write some info to a file, like TTY = `tty`. ip-up can then check for this file and source it. I have used this method under linux to pass info and flags to ip-up, to pass stuff like "check the pop mail or not", "flush the queue or not", "shutdown the link now or later or never", and so on, but not for tty output. It might work. Dave To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message