From owner-freebsd-questions Fri May 22 15:03:38 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA28591 for freebsd-questions-outgoing; Fri, 22 May 1998 15:03:38 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from smtp.enteract.com (thor.enteract.com [206.54.252.9]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id PAA28574 for ; Fri, 22 May 1998 15:03:30 -0700 (PDT) (envelope-from tkim@mcs.net) Received: (qmail 17779 invoked from network); 22 May 1998 22:03:25 -0000 Received: from kebob-1.d.enteract.com (HELO mcs.net) (207.229.149.206) by thor.enteract.com with SMTP; 22 May 1998 22:03:25 -0000 Message-ID: <3565F837.1D2EBE9D@mcs.net> Date: Fri, 22 May 1998 17:12:07 -0500 From: Anthony Kim Organization: deus ex machina X-Mailer: Mozilla 4.05 [en] (X11; I; FreeBSD 2.2.6-RELEASE i386) MIME-Version: 1.0 To: djv@bedford.net CC: freebsd-questions@FreeBSD.ORG Subject: Re: PPP Scripting Advice References: <199805221644.MAA20525@lucy.bedford.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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` 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 I'm not a shell expert so if there's some syntax I don't see please advise. Rgds, Anthony CyberPeasant wrote: > > Anthony Kim wrote: > > Hey Folks, > > Two questions. > > > > I use the following dial up script for ppp: > > > > #!/bin/sh > > pppd /dev/cuaa0 115200 connect 'chat -f /etc/ppp/dial.chat' & > > > > How would I configure it to echo something like > > Connection completed. Your IP address is: $$ > > I believe pppd will look for a script /etc/ppp/ip-up > The IP addresses are among the arguments passed to that script. > (man pppd for the rest). > > > > > > > 2nd question: > > I run the following to kill pppd: > > #!/bin/sh > > echo "Killing pppd, please wait." > > cat /var/run/ppp0.pid | xargs kill > > Well, that's a little bit roundabout. > > if [ -f /var/run/ppp0/pid ] ; then > kill -SIGNAL `cat /var/run/ppp0.pid` > else > echo PPPd does not seem to be running > fi > > might be more "usually worded". Subsitute the signal of your > choice for "SIGNAL" there. Likely choices are -INT -TERM and -HUP > (See man pppd for details.) > > > > > > > It works fine except I have the feeling that I'm missing > > something here. It seems too easy. netstat -rn and ifconfig -a > > No, pppd catches these signals and goes through the appropriate > line negotiations for a clean shutdown. > > > show the kill is complete and everything is flushed. If anyone > > has a good script, I'd love to hear it. > > > > At some point, pppd will call /etc/ppp/ip-down, after it's been HUPped > or whatever.You can get fancy in there, although there really isn't > much to do in the usual case. Clean up any special routes, maybe. > Some kind of special purpose modem reset, accounting, whatever. > > Dave > -- > Unix System 7: > an improvement on all other Unix releases, previous and subsequent. -- Fingerprint: 2CDE 798E 4140 332C 72D9 0F57 B786 DA9B CBC3 4592 "The conclusion I have reached is that reading is an operation without object; or that its true object is itself." --Italo Calvino "First and foremost, I think of myself as a reader." --Borges To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message