Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 May 1998 04:42:39 -0400 (EDT)
From:      CyberPeasant <djv@bedford.net>
To:        tkim@mcs.net (Anthony Kim)
Cc:        djv@bedford.net, freebsd-questions@FreeBSD.ORG
Subject:   Re: PPP Scripting Advice
Message-ID:  <199805230842.EAA26298@lucy.bedford.net>
In-Reply-To: <3565F837.1D2EBE9D@mcs.net> from Anthony Kim at "May 22, 98 05:12:07 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199805230842.EAA26298>